9 Programming the Instrument
9.4 Status Register System & STATus Subsystem
–
Determine which bit monitors the condition
–
Determine how that bit reports to the request service (RQS) bit of the status byte
–
Send SCPI commands to enable the bit that monitors the condition and to
enable the summary bits that report the condition to the RQS bit
–
Enable the controller to respond to service requests
When the condition changes, the instrument sets its RQS bit. The controller is
informed of the change as soon as it occurs. As a result, the time the controller
would otherwise have used to monitor the condition can be used to perform other
tasks. Your program determines how the controller responds to the SRQ.
Bit 6 of the "Status Byte Register" on page 2459 is the request service (RQS) bit. Use
*SRE to configure the RQS bit to report changes in instrument status. When such a
change occurs, the RQS bit is set. It is cleared when the Status Byte Register is
queried using *SRE? (with a serial poll.) It can be queried without erasing the
contents by using *STB?.
When a register being set causes a summary bit in the status byte to change from 0
to 1, the instrument can initiate the service request (SRQ) process. However, the
process is only initiated if both the following conditions are true:
The corresponding bit of the service request enable register is also set to 1
The instrument does not have a service request pending. (A service request is
considered to be pending between the time the instrument’s SRQ process is
initiated and the time the controller reads the status byte register)
The SRQ process sets the SRQ true. It also sets the status byte’s request service
(RQS) bit to 1. Both actions are necessary to inform the controller that the instrument
requires service. Setting the SRQ line only informs the controller that some device
on the bus requires service. Setting the RQS bit allows the controller to determine
which instrument requires service.
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 SRQ 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 instrument’s Status Byte Register using a serial poll, the RQS
bit is reset to 0. Other bits in the register are not affected.
If the status register is configured to SRQ on end-of-measurement, and the
measurement is in Continuous mode, then restarting a measurement (via :INIT)
can cause the measuring bit to pulse low. This causes an SRQ even though you have
not actually reached the "end-of-measurement" condition. To avoid this:
2457 Short Range Comms & IoT Mode User's &Programmer's Reference