3-18
3.8.2 Detecting calibration errors
If an error occurs during any calibration step, the Model
6517A will generate one of the error messages summarized
above. Several methods to detect calibration errors are dis-
cussed below.
Error queue
As with other Model 6517A errors, any calibration errors
will be reported in the bus error queue. You can read this
queue by using the appropriate error query (see paragraph
3.8.1). The Model 6517A will respond with the appropriate
error message, as summarized in Appendix B.
Status byte EAV (Error Available) bit
Whenever an error is available in the error queue, the EAV
(Error Available) bit (bit 2) of the status byte will be set. Use
the *STB? query or serial polling to obtain the status byte,
then test bit 2 to see if it is set. If the EAV bit is set, an error
has occurred, and you can use the appropriate error query to
read the error and at the same time clear the EAV bit in the
status byte. Use :SYST;ERR? for appropriate detailed error
queue message.
Generating an SRQ on error
To program the instrument to generate an SRQ when an error
occurs, send the following command: *SRE 4. This com-
mand will enable SRQ when the EAV bit is set. You can then
read the status byte and error queue as outlined above to
check for errors and to determine the exact nature of the
error.
3.9
Detecting calibration step completion
When sending calibration commands over the IEEE-488
bus, you must wait until the instrument completes the current
operation before sending a command. You can use either
*OPC? or *OPC to help determine when each calibration
step is completed.
3.9.1 Using the *OPC? query
With the *OPC? (operation complete) query, the instrument
will place an ASCII 1 in the output queue when it has com-
pleted each step. To determine when the OPC response is
ready, do the following:
1. Repeatedly test the MAV (Message Available) bit (bit 4)
in the status byte and wait until it is set. (You can request
the status byte by using the *STB? query or serial
polling.)
2. When MAV is set, a message is available in the output
queue, and you can read the output queue and test for an
ASCII 1.
3. After reading the output queue, repeatedly test MAV
again until it clears. At this point, the calibration step is
completed.
3.9.2 Using the *OPC command
The *OPC (operation complete) command can also be used
to detect the completion of each calibration step. In order to
use *OPC to detect the end of each calibration step, you must
do the following:
1. Enable operation complete by sending *ESE 1. The
command sets the OPC (operation complete bit) in the
standard event enable register, allowing operation com-
plete status from the standard event status register to set
the ESB (event summary bit) in the status byte when
operation complete is detected.
2. Send the *OPC command immediately following each
calibration command. For example:
:CAL:PROT:VZERO2;*OPC
Note that you must include the semicolon (;) to separate
the two commands, and that the *OPC command must
appear on the same line as the command.
3. After sending a calibration command, repeatedly test
the ESB (Event Summary) bit (bit 5) in the status byte
until it is set. (Use either the *STB? query or serial poll-
ing to request the status byte.)
4. Once operation complete has been detected, clear OPC
status using one of two methods: (1) Use the *ESR?
query, then read the response to clear the standard event
status register, or (2) Send the *CLS command to clear
the status registers. Note that sending *CLS will also
clear the error queue and operation complete status.
3.9.3 Generating an SRQ on calibration complete
An SRQ (service request) can be used to detect operation
complete instead of repeatedly polling the Model 6517A. To
use this method, send both *ESE 1 and *SRE 32 to the
instrument, then include the *OPC command at the end of
each calibration command line, as covered in paragraph
3.9.2. Clear the SRQ by querying the ESR (using the *ESR?
query) to clear OPC status, then request the status byte with
serial polling or the *STB? query.
Refer to your controller's documentation for information on
detecting and servicing SRQs.