10-9
630 END IF
640 IF BIT (3, ESR) = 1 THEN
650 PRINT “∗∗∗ DDE error ∗∗∗”
660 WRITE @108 : “ERR?”
670 READ @108 : ERR $
680 PRINT “Error code = ” : ERR $
690 END IF
700 IF BIT (4, ESR) = 1 THEN
710 PRINT “∗∗∗ EXE error ∗∗∗”
720 WRITE @108 : “ERR?”
730 READ @108 : ERR $
740 PRINT “Error code = ” : ERR $
750 END IF
760 IF BIT (5, ESR) = 1 THEN
770 PRINT “∗∗∗ Command error ∗∗∗”
780 END IF
790 END IF
800 WRITE @108 : “∗CLS”
810 GO TO GPINT
820 END PARACT
Lines 70 to 90: Define SRQ and start the interrupt processing block “GPIB.”
Line 100: Declare the error handler “READERR.”
Lines 120 to 150: Clear and set enable registers. (For more details, see Section 7.)
Enable event status (ESB) and ERROR bits of the status byte register. Enable com-
mand error, EXE error, DDE error, and query error bits of the event status byte.
Enable the RES_Uncal bit of the extended event status byte.
As the result, an SRQ interrupt occurs when a command error, EXE error, DDE
error, query error, or RES_Uncal error occurs.
Line 170: Set the READ command time-out time to 3 seconds.
When a query error occurs, the READ command following the query command
must be executed within the specified time. The reason is that the READ command
is not completed for ever when a query command error occurs. That is, the READ
instruction must be terminated forcibly to prevent deadlock.
In this program, control is transferred to the error handler “READ ERR” on line 400
when time-out occurs.
Lines 180 to 200: Execute desired commands. In this example, these lines are used to write a com-
ment.
Lines 400 to 430: An error handler processing block. This block is executed when READ command
time-out occurs. An error message is printed and processing is continued.
Lines 500 to 820: An SRQ processing block.
When an interrupt occurs, the processing specified on line 530 and later is per-
formed. The status byte and event status byte are read to check the error, and the
check result is printed.
When a DDE or EXE error occurs, the error code is checked and printed.
10.2 Program Examples