Chapter 2
18 Programming the Status System
• Enable SRQ Handler in SICL with ionsrq.
• Enable MAV bit (Message Available Bit) and Standard Event Status Register Summary Bit in the Status Byte Enable Register (e.g. *SRE 48). This will cause an SRQ to arrive when there is a message in the output queue or when the summary bit is set in the standard event status register.
• Enable the Command Error, Execution Error, Device Dependent Error, and Query Error enable bits in the Standard Event status enable register (e.g. *ESE 60). This will cause the summary bit of the standard event status register to be set when an error occurs.
Define a SRQ Handler which does the following:
•
The following example program sets up an SRQ handler to be called when SCPI errors are detected using the Standard Event Status Register. The program then prompts for SCPI commands. If the SCPI command results in data in the output queue (such an query command) or an error, then the SRQ handler is called and the data is printed.
The following summarizes the procedure used:
Using a Service Request to Detect Errors
iclose(id);
}