Download Manual - Phase Matrix
Transcript
5/PROGRAMMING bit7 6 5 4 (128) (64) (32) (16) 3 (8) 2 (4) 1 (2) bit0 (1) Input buffer empty IRQ bit (Master Summary Status) Error condition Overload Gate on Search on Signal found Valid measurement result (data) ready Figure 5-1. Status Byte Structure SERVICE REQUEST MASK The counter can be instructed to send an interrupt, by setting the SRQ line on the GPIB, when any ORed combination of the bits in the status byte are set. This is done by sending the counter a service request mask. For example, to instruct the counter to generate an SRQ whenever it has valid data available or an error condition exists, send the following service request mask: Send 0, 18, “SRQMASK 33", NLend This would tell the counter to generate an SRQ whenever bit 0 and bit 5 of the status byte are set. Since bit 0 corresponds to valid measurement result ready and bit 5 corresponds to an error condition, the counter would generate an SRQ whenever either an error condition exists or a valid measurement is available. The following items should be included in any program using the SRQ feature: 1. Tell the counter when to generate an SRQ. That is, tell the counter which events should generate an SRQ. This is done using the SRQMASK command. 2. Tell the controller to monitor the SRQ line on the GPIB. The SRQ is a maskable interrupt and the controller needs to know if it should respond to the interrupt. 3. Tell the controller what to do when it receives an SRQ interrupt. 4. Serial poll the counter after an SRQ is generated to clear the interrupt. When the counter generates an SRQ it sets bit 6 in the status byte. Serial polling the instrument clears the SRQ bit and allows the instrument to generate a new SRQ upon the next occurrence of the conditions specified in the SRQ Mask. 5. It may also be necessary to clear the SRQ register in the controller. Consult your manual on the controller for more information on clearing the SRQ register in the controller. 5-13