Programming instructions

Programming the Status Register System
Accessing Status Register Information
Chapter 3108
Using the Service Request (SRQ) Method
The programming language, I/O interface, and programming environment must support SRQ
interrupts (for example: BASIC or VISA used with GPIB and VXI-11 over the LAN). Using
this method, you must do the following:
1. Determine which bit monitors the condition.
2. Send commands to enable the bit that monitors the condition (transition registers).
3. Send commands to enable the summary bits that report the condition (event enable
registers).
4. Send commands to enable the status byte register to monitor the condition.
5. Enable the controller to respond to service requests.
The controller responds to the SRQ as soon as it occurs. As a result, the time the controller
would otherwise have used to monitor the condition, as in a loop method, can be used to
perform other tasks. The application determines how the controller responds to the SRQ.
When a condition changes and that condition has been enabled, the RQS bit in the status byte
register is set. In order for the controller to respond to the change, the Service Request Enable
Register needs to be enabled for the bit(s) that will trigger the SRQ.
Generating a Service Request The Service Request Enable Register lets you choose the
bits in the Status Byte Register that will trigger a service request. Send the *SRE <num>
command where <num> is the sum of the decimal values of the bits you want to enable.
For example, to enable bit 7 on the Status Byte Register (so that whenever the Standard
Operation Status register summary bit is set to 1, a service request is generated) send the
command *SRE 128. Refer to Figure 3-1 on page 103 or Figure 3-2 on page 104 for bit
positions and values.
The query command *SRE? returns the decimal value of the sum of the bits previously
enabled with the *SRE <num> command.
To query the Status Byte Register, send the command *STB?. The response will be the
decimal sum of the bits which are set to 1. For example, if bit 7 and bit 3 are set, the decimal
sum will be 136 (bit 7=128 and bit 3=8).
NOTE Multiple Status Byte Register bits can assert an SRQ, however only one bit at a
time can set the RQS bit. All bits that are asserting an SRQ will be read as part
of the status byte when it is queried or serial polled.
The SRQ process asserts SRQ as true and sets the status byte’s RQS bit to 1. Both actions are
necessary to inform the controller that the signal generator requires service. Asserting SRQ