National Instruments NI-488.2 Time Clock User Manual


 
GPIB Programming Techniques Chapter 7
NI-488.2 User Manual for Windows 7-6 © National Instruments Corp.
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.
Automatic Serial Polling
You can enable automatic serial polling if you want your application to conduct a serial
poll automatically any time the SRQ line is asserted. The autopolling procedure occurs
as follows:
1. To enable autopolling, use the configuration utility, wibconf, or the configuration
function, ibconfig with option IbcAUTOPOLL. (Autopolling is enabled by
default.)
2. When the SRQ line is asserted, the driver automatically serial polls the open devices.
3. Each positive serial poll response (bit 6 or hex 40 is set) is stored in a queue
associated with the device that sent it. The RQS bit of the device status word,
ibsta, is set.
4. The polling continues until SRQ is unasserted or an error condition is detected.
5. To empty the queue, use the ibrsp function. ibrsp returns the first queued
response. Other responses are read in first-in-first-out (FIFO) fashion. If the RQS
bit of the status word is not set when ibrsp is called, a serial poll is conducted and
returns whatever response is received. You should empty the queue as soon as an
automatic serial poll occurs, because responses might be discarded if the queue is
full.
6. If the RQS bit of the status word is still set after ibrsp is called, the response byte
queue contains at least one more response byte. If this happens, you should continue
to call ibrsp until RQS is cleared.
Stuck SRQ State
If autopolling is enabled and the GPIB interface board detects an SRQ, the driver serial
polls all open devices connected to that board. The serial poll continues until either SRQ
unasserts or all the devices have been polled.