2-46
Sample Programs
Listings of the Sample Programs
950 PRINT !which represents the response to the interrupted query above
960 PRINT Buf$
970 PRINT
980 SUBEND
990 !
1000 !
1010 !
1020 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1030 !
1040 !
1050 ! Subprogram name: Srq_handler
1060 ! Parameters: none
1070 ! Return value: none
1080 ! Description: This routine verifies the status of the SRQ line. It then checks
1090 ! the status byte of the scope to determine if the scope caused the
1100 ! SRQ. Note that using a SPOLL to read the status byte of the scope
1110 ! clears the SRQ and allows another to be generated. The error queue
1120 ! is read until all errors have been cleared. All event registers and
1130 ! queues, except the output queue, are cleared before control is returned
1140 ! to the main program.
1150 !
1160 !
1170 !
1180 SUB Srq_handler
1190 COM /Io/@Scope,Interface
1200 DIM Error_str$[64]
1210 INTEGER Srq_asserted,More_errors
1220 Status_byte=SPOLL(@Scope)
1230 IF BIT(Status_byte,6) THEN
1240 More_errors=1
1250 WHILE More_errors
1260 OUTPUT @Scope;":SYSTem:ERROR? STRING"
1270 ENTER @Scope;Error_str$
1280 PRINT
1290 PRINT Error_str$
1300 IF Error_str$[1,1]="0" THEN
1310 OUTPUT @Scope;"*CLS"
1320 More_errors=0
1330 END IF
1340 END WHILE
1350 ELSE
1360 PRINT
1370 PRINT "Scope did not cause SRQ"
1380 PRINT
1390 END IF
1400 ENABLE INTR Interface;2 !re-enable SRQ
1410 SUBEND
1420 !
1430 !
1440 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1450 !
1460 ! Subprogram name: Close
1470 ! Parameters: none
1480 ! Return value: none
1490 ! Description: This routine resets the interface.
1500 !