Chapter 8 95
Avoiding Mistakes Related to Work and Daily Checks
Avoiding Mistakes Related To Work
8. Avoiding Mistakes Related
to Work and Daily Checks
Detecting the occurrence of an error
Using error queue
The error queue contains the error number and error message of an error that has occurred.
By reading out the contents of the error queue, you can find out which error has occurred.
To read out the contents of the error queue, use the following command.
• :SYST:ERR? on page 192
You can use the error queue in the following ways.
1. You can use it to make a branch for error handling in your program. When you read out
the contents of the error queue, 0 and “No error” are read out as the error number and
error message if no error has occurred. This result helps you to determine whether an
error has occurred and to make the branch of your program’s flow. You can also use it
to restrict error handling to the occurrence of a specific error. However, it is difficult to
use this method to perform processing during the occurrence of an error.
2. You can use it to investigate the kind of error that has occurred when an error is
detected by using SRQ and other means. Refer to the sample program in Example 8-1.
Using status report system
You can detect the status of the 4288A by using the status register. This section describes
how to detect the occurrence of an error by using the status register. For information on the
entire status report system (for example, information on each bit of the status register),
refer to Appendix C, “Status Reporting System,” on page 247.
The occurrence of an error is indicated by the standard event status register. An SRQ
(service request), which is useful for detecting the occurrence of an error in your program,
uses the information indicated by this register.
To detect the end of sweep with an SRQ, use the following commands.
• *SRE on page 127
• *ESE on page 124
The procedure is given below.
Step 1. Set the 4288A to generate an SRQ if one of the error occurrence bits of the standard event
status register is set to 1.
Step 2. Perform interrupt handling in the program when SRQ occurs.