Agilent Technologies E1300B User Manual

Page 125

Advertising
background image

Example: Interrupting when an Error Occurs

This program shows how to interrupt an external computer whenever an error
occurs for the instrument being programmed which, in this example, is a
multimeter at secondary address 03.

10 OPTION BASE 1

!Array numbering starts with 1

20 ON INTR 7 CALL Errmsg

!When SRQ occurs on interface 7, call subprogram

30 ENABLE INTR 7;2

!Enable SRQ interrupt, interface 7

40 OUTPUT 70903;"* SRE 32"

!Enable bit 5 (Standard Event Status Bit) in Status Byte
Register

50 OUTPUT 70903;"* ESE 60"

!Enable error bits (bits 2-5) in Standard Event Status Register
to be reflected
! in Status Byte Register

60 OUTPUT 70903;"MEAS:TEMP? TC,T,(@104)"

!Measure temperature with voltmeter

70 WAIT 2

80 ENTER 70903;Tmp_rdg

!Enter temperature reading

90 PRINT Tmp_rdg

!Print temperature reading

100 END

110 SUB Errmsg
120 DIM Message$[256]

!Create array for error message

130 CLEAR 70903

!Clear multimeter

140 B= SPOLL(70903)

!Serial poll multimeter (clears SRQ)

150 REPEAT

!Repeat next 3 lines until error number = 0

160 OUTPUT 70903;"SYST:ERR?"

!Read error from queue

170 ENTER 70903;Code,Message$

!Enter error number & message

180 PRINT Code,Message$

!Print error number & message

190 UNTIL Code= 0
200 OUTPUT 70903;"* CLS"

!Clear status structures

210 STOP

220 SUBEND

Controlling Instruments Using GPIB 6-11

Advertising
This manual is related to the following products: