User`s manual

BASIC Program Example (ERRORCHK)
1 !RE-STORE"ERRORCHK"
2 !This program represents the method used to check for programming
3 !errors in BASIC programs.
4 !
10 !Assign I/O path between the computer and E1445A.
20 ASSIGN @Afg TO 70910
30 COM @Afg
40 !Define branch to be taken when an E1445A error occurs.
50 !Enable GPIB interface to generate an interrupt when an error
60 !occurs.
70 ON INTR 7 CALL Errmsg
80 ENABLE INTR 7;2
90 !Clear all bits in the Standard Event Status Register, unmask the
100 !Standard Event Status Group summary bit in the E1445A Status Byte
110 !register (decimal weight 32), unmask the query error, device
120 !dependent error, execution error, and command error bits
130 !(decimal sum 60) in the E1445A Standard Event Status Register.
140 OUTPUT @Afg;"*CLS"
150 OUTPUT @Afg;"*SRE 32"
160 OUTPUT @Afg;"*ESE 60"
170 !
180 !Subprogram calls would be here
190 !
200 WAIT .1 !allow error branch to occur before turning intr off
210 OFF INTR 7
220 END
230 !
240 SUB Errmsg
250 Errmsg: !Subprogram which displays E1445 programming errors
260 COM @Afg
270 DIM Message$[256]
280 !Read AFG status byte register and clear service request bit
290 B=SPOLL(@Afg)
300 !End of statement if error occurs among coupled commands
310 OUTPUT @Afg;""
320 OUTPUT @Afg;"ABORT" !abort output waveform
330 REPEAT
340 OUTPUT @Afg;"SYST:ERR?" !read AFG error queue
350 ENTER @Afg;Code,Message$
360 PRINT Code,Message$
370 UNTIL Code=0
380 STOP
390 SUBEND
Comments
Clearing the service request bit (bit 6 (RQS)) in the Status Byte
Register (line 290) when the interrupt is serviced allows the bit to be
set again when the next summary bit is received.
Chapter 9 AFG Status 441