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
Содержание 5502A
Страница 4: ......
Страница 12: ...5502A Operators Manual xii ...
Страница 46: ...5502A Operators Manual 2 2 ...
Страница 52: ...5502A Operators Manual 2 8 ...
Страница 54: ...5502A Operators Manual 3 2 ...
Страница 70: ...5502A Operators Manual 3 18 S1 S to T to S1 gvx032 eps Figure 3 4 SETUP Softkey Menu Displays cont ...
Страница 142: ...5502A Operators Manual 4 68 ...
Страница 193: ...6 1 Chapter 6 Remote Commands Title Page Introduction 6 3 Command Summary by Function 6 3 Commands 6 10 ...
Страница 194: ...5502A Operators Manual 6 2 ...
Страница 240: ...5502A Operators Manual 7 2 ...
Страница 260: ...5502A Operators Manual 7 22 ...
Страница 261: ...8 1 Chapter 8 Accessories Title Page Introduction 8 3 Rack Mount Kit 8 4 IEEE 488 Interface Cable 8 4 5500A LEADS 8 4 ...
Страница 262: ...5502A Operators Manual 8 2 ...
Страница 365: ...B 1 Appendix B ASCII and IEEE 488 Bus Codes ...
Страница 366: ...5502A Operators Manual B 2 ...
Страница 368: ...5502A Operators Manual B 4 ...
Страница 378: ...5502A Operators Manual D 6 ...