62 Chapter 2
Status Registers
Use Status Registers to Determine the State of Analyzer Events and Conditions
NOTE If you are using the status bits and the analyzer mode is changed, the status bits
should be read, and any error conditions resolved, prior to switching modes. Error
conditions that exist prior to switching modes cannot be detected using the
condition registers after the mode change. This is true unless they recur after the
mode change, although transitions of these conditions can be detected using the
event registers.
Changing modes resets all SCPI status registers and mask registers to their
power-on defaults. Hence any event or condition register masks must be
re-established after a mode change. Also note that the power up status bit is set by
any mode change, since that is the default state after power up.
Status Subsystem Commands
Individual status registers can be set and queried using the commands in the
STATus subsystem in Chapter 5, Language Reference, in this guide. There are
two methods used to programmatically detect and manage error conditions or
changes in analyzer status. Either method allows you to monitor one or more
conditions. The two methods are:
The Polling Method
The Service Request (SRQ) Method
The Polling Method
In the polling method, the analyzer has a passive role. It only tells the controller
that conditions have changed when the controller asks the right question. The
polling method works well if you do not need to know about changes the moment
they occur. This method is very efficient.
Use the polling method when either:
your programming language/development environment does not support SRQ
interrupts
you want to write a simple, single-purpose program and dont want the added
complexity of setting up an SRQ handler
The Service Request (SRQ) Method
The SRQ method allows timely communication of information without requiring
continuous controller involvement. Using this method, the analyzer takes a more
active role. It tells the controller when there has been a condition change without
the controller asking. The SRQ method should be used if you must know
immediately when a condition changes. This is in contrast to the polling method,
which requires the program to re peatedly read the registers to de tect a change.