Chapter 2 75
Programming Fundamentals
Using the Instrument Status Registers
Generating a Service Request
To use the SRQ method, you must understand how service requests are
generated. Bit 6 of the status byte register is the request service (RQS)
bit. The RQS bit is set whenever something (that it has been configured
to report using *SRE) changes. It is cleared when the status byte
register is queried using *SRE? (with a serial poll.) It can be queried
without erasing the contents with *STB?.
When a register 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 of 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 GPIB SRQ line 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 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 instrument’s 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 (INIT command) can cause the measuring
bit to pulse low, which causes an SRQ if the status register is configured
to SRQ on end-of-measurement. To avoid this:
1. Set INITiate:CONTinuous off.
2. Set/enable the status registers.
3. Restart the measurement (send INIT).