Agilent Technologies E4406A VSA Satellite Radio User Manual


 
80 Chapter 2
Programming Fundamentals
Using the Instrument Status Registers
Using a Status Register
Each bit in a register is represented by a numerical value based on its
location. See Figure 2-1 below. This number is sent with the command,
to enable a particular bit. If you want to enable more than one bit, you
would send the sum of all the bits that you are interested in.
For example, to enable bit 0 and bit 6 of standard event status register,
you would send the command *ESE 65 because 1 + 64 = 65.
The results of a query are evaluated in a similar way. If the *STB?
command returns a decimal value of 140, (140 = 128 + 8 + 4) then bit 7
is true, bit 3 is true and bit 2 is true.
Figure 2-1 Status Register Bit Values
NOTE Bit 15 is not used to report status.
Using the Service Request (SRQ) Method
Your language, bus and programming environment must be able to
support SRQ interrupts. (For example, BASIC used with the GPIB.)
When you monitor a condition with the SRQ method, you must:
1. Determine which bit monitors the condition.
2. Determine how that bit reports to the request service (RQS) bit of
the status byte.
3. Send GPIB commands to enable the bit that monitors the condition
and to enable the summary bits that report the condition to the RQS
bit.
4. Enable the controller to respond to service requests.
When the condition changes, the instrument sets its RQS bit and the
GPIB SRQ line. 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.