64
Chapter 2
Status Registers
Use Status Registers to Determine the State of Analyzer Events and Conditions
If your program enables the controller to detect and respond to service requests, it
should instruct the controller to perform a serial poll when the GPIB SRQ line is
set true. Each device on the bus returns the contents of its status byte register in
response to this poll. The device, whose RQS bit is set to 1, is the device that
requested service.
NOTE
When you read the analyzer status byte register with a serial poll, the RQS bit is
reset to 0. Other bits in the register are not affected.
Restarting a measurement with the
:INITiate
command can cause the
measuring bit to pulse low. A low pulse causes an SRQ if the status register is
configured to SRQ upon end-of-measurement. To avoid this, perform the
following steps:
1. Set
:INITiate:CONTinuous
off.
2. Set/enable the status registers.
3. Restart the measurement (send
:INITiate
).
Example of Monitoring Conditions Using the :STATus Command
Use the following steps to monitor a
specific
condition:
1. Determine which register contains the bit that reports the condition.
2. Send the unique SCPI query that reads that register.
3. Examine the bit to see if the condition has changed.
4. Act upon the cause of the condition and the SRQ to re-enable the method.
The examples below show how to use the
:STATus
command to perform the
following tasks:
•
Check the analyzer hardware and firmware status.
Do this by querying the condition registers which continuously monitor status.
These registers represent the current state of the analyzer. Bits in a condition
register are updated in real time. When the condition monitored by a particular
bit becomes true, the bit is set to 1. When the condition becomes false, the bit is
reset to 0.
•
Monitor a particular bit (condition), or bits.
Once you have enabled a bit using the event enable register, the analyzer will
monitor that particular bit. If the bit becomes true in the event register it will
stay set until the event register is cleared. Querying the event register allows
you to detect that this condition occurred even if the condition no longer exists.
The event register can only be cleared by querying it or sending the
*CLS
command, which clears all event registers.
•
Monitor a change in the condition of a particular bit, or bits.
Once you have enabled a bit, the analyzer will monitor it for a change in its
condition. The transition registers are preset to respond to the condition of
going from 0 to 1 (positive transitions). This can be changed so that the selected
bit is detected if it goes from 1 to 0 (negative transition), or if either transition
occurs. Query the event register to determine whether or not a change has been
made to how the transition registers respond. The event register can only be
cleared by querying it or sending the
*CLS
command, which clears all event
registers.