National Instruments NI-488.2 ユーザーズマニュアル

ページ / 135
Chapter 7
NI-488.2 Programming Techniques
7-12
www.natinst.com
the application could monitor the status bits TACS (Talker Active State) 
and LACS (Listener Active State) to determine when to send data to or 
receive data from the Controller. The application could also monitor the 
DCAS (Device Clear Active State) and DTAS (Device Trigger Active 
State) bits to determine if the Controller has sent the device clear (DCL or 
SDC) or trigger (GET) messages to the interface. If the application detects 
a device clear from the Controller, it might reset the internal state of 
message buffers. If it detects a trigger message from the Controller, the 
application might begin an operation, such as taking a voltage reading if the 
application is actually acting as a voltmeter.
Serial Polling
You can use serial polling to obtain specific information from GPIB 
devices when they request service. When the GPIB SRQ line is asserted, it 
signals the Controller that a service request is pending. The Controller must 
then determine which device asserted the SRQ line and respond 
accordingly. The most common method for SRQ detection and servicing is 
the serial poll. This section describes how to set up your application to 
detect and respond to service requests from GPIB devices. 
Service Requests from IEEE 488 Devices
IEEE 488 devices request service from the GPIB Controller by asserting 
the GPIB SRQ line. When the Controller acknowledges the SRQ, it serial 
polls each open device on the bus to determine which device requested 
service. Any device requesting service returns a status byte with bit 6 set 
and then unasserts the SRQ line. Devices not requesting service return a 
status byte with bit 6 cleared. Manufacturers of IEEE 488 devices use lower 
order bits to communicate the reason for the service request or to 
summarize the state of the device. 
Service Requests from IEEE 488.2 Devices
The IEEE 488.2 standard refined the bit assignments in the status byte. In 
addition to setting bit 6 when requesting service, IEEE 488.2 devices also 
use two other bits to specify their status. Bit 4, the Message Available bit 
(MAV), is set when the device is ready to send previously queried data. 
Bit 5, the Event Status bit (ESB), is set if one or more of the enabled 
IEEE 488.2 events occurs. These events include power-on, user request, 
command error, execution error, device dependent error, query error, 
request control, and operation complete. The device can assert SRQ when 
ESB or MAV are set, or when a manufacturer-defined condition occurs.