User`s manual
Checking for Errors The following BASIC program shows the lines and subprogram which are
added to the BASIC programs to check for errors. Line 140 clears the AFG
Standard Event Status Register. Lines 150 and 160 unmask the appropriate
bits in the AFGs Status Byte Register and Standard Event Status Register.
When an error occurs, the subprogram "Errmsg" reads the AFG error queue
and displays the code and message. Note that line 310 is used as an "end of
statement" should a syntax error occur among coupled commands.
Otherwise, line 320 would serve as the end of statement and the
ABORT
command would be ignored by the AFG parser.
Note An alternative BASIC error checking program can be found in the C-Size
VXIbus Systems Configuration Guide. Error checking routines for Visual
C/C++ language and Visual BASIC programs are found in programs
ARBWAVE.C and ARBWAVE.FRM, listed previously in this chapter.
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
Continued on Next Page
Chapter 1 Getting Started 49