Remote Operation
Remote Program Examples
5
5-47
Make sure that there are no for programming errors as in the subsequent sample
programs. Verify the Error Available (EAV) bit in the serial poll register with a serial
poll.
300 A = SPL(6) ! CHECK FOR ERRORS
310 IF (A AND 8) THEN PRINT “There was an error”
320 PRINT @6, “*CLS” ! CLEAR ERRORS
Get errors and explanations as follows. Since errors are accumulated in a queue, you must
read the complete queue to get and clear all the errors.
400 PRINT @6, “ERR?” ! CHECK FOR ERRORS
410 INPUT @6, A, A$ ! READ IN THE ERROR
420 IF (A = 0) THEN GOTO 500 ! NO MORE ERRORS
430 PRINT “Error# :”; A, A$ ! PRINT ERROR# AND EXPLANATION
440 GOTO 400
500 END
Write an SRQ and Error Handler
It is good to include fault (error) handling routines in your procedures. The subsequent
sample program lines show a procedure to stop program execution on occurrence of an
SRQ (Service Request) on the bus, see if the Calibrator is the source of the SRQ, get its
fault messages, and act on the faults. You must change and extend this code as necessary
for your procedure.
To use SRQs, first use the
*SRE
,
*ESE
, and
ISCE
commands to enable the necessary
event. Refer to "Check the 5502A Status" for more information.
10 INIT PORT0 ! IFC the bus
20 CLEAR PORT0 ! DCL the bus
30 ! INITIALIZE THE 5502A SRQ HANDLER
40 PRINT @6,
“
*SRE 8
”
! Enable STB.EAV (error available)
50 ON SRQ GOTO 1100 ! Install SRQ handler
60 ! Body of the application goes here
1100 ! Bus SRQ handler
1110 CLEAR PORT0 ! Make sure devices are not confused
1120 IF (SPL(6) AND 64) THEN GOSUB 1200 ! If (STB.RQS) call SRQ
1130 ! TEST OTHER DEVICES RQS BITS IF DESIRED
1140 RESUME
1200 ! 5502A SRQ handler
1210 IF (SPL(6) AND 8) THEN GOSUB 1300 ! If (STB.EAV) call handler
1220 ! Test other STB bits if desired here
1299 RETURN
1300 ! 5502A STB.EAV (error) handler
1320 PRINT @6,
“
ERR?
”
! Read and clear error
1330 INPUT @6, E%, E$ ! Read in error # and explanation
1340 PRINT
“
Error# :
”;
E, E$ ! Print error # and explanation
1350 IF (E% <> 0) THEN GOTO 1320 ! Until no more errors
1360 STOP ! Other commands for your app
1370 END
Summary of Contents for 5502A
Page 4: ......
Page 12: ...5502A Operators Manual xii ...
Page 46: ...5502A Operators Manual 2 2 ...
Page 52: ...5502A Operators Manual 2 8 ...
Page 54: ...5502A Operators Manual 3 2 ...
Page 142: ...5502A Operators Manual 4 68 ...
Page 194: ...5502A Operators Manual 6 2 ...
Page 240: ...5502A Operators Manual 7 2 ...
Page 260: ...5502A Operators Manual 7 22 ...
Page 262: ...5502A Operators Manual 8 2 ...
Page 365: ...B 1 Appendix B ASCII and IEEE 488 Bus Codes ...
Page 366: ...5502A Operators Manual B 2 ...
Page 368: ...5502A Operators Manual B 4 ...
Page 378: ...5502A Operators Manual D 6 ...