National Instruments 320682C Musical Toy Instrument User Manual


 
GPIB/GPIB-488.2 Library Chapter 4
LabWindows/CVI Standard Libraries 4-8 © National Instruments Corporation
included in the wait mask. Aside from the difficulty caused by ESRQ in waiting for RQS, the
error will have no detrimental effects on other GPIB operations.
If you call the serial poll function ibrsp and have received one or more responses previously
via the automatic serial poll feature, the ibrsp function returns the first queued response. Other
responses are read in FIFO (first-in-first-out) fashion. If the RQS bit of the status word is not set
when you call ibrsp, the function conducts a serial poll and returns whatever response it
receives.
If your application requires that requests for service be noticed, call the ibrsp function
whenever the RQS bit appears in the status word. A serial poll response queue of a device can
overflow with old status bytes when you neglect to call ibrsp. ibrsp returns the error
condition ESTB when status bytes have been discarded because the queue is full. If your
application has no interest in SRQ or status bytes, you can ignore the occurrence of the automatic
polls.
Note: If the RQS bit of the device status word is still set after you call ibrsp, the response
byte queue has at least one more response byte remaining. You should call ibrsp
until RQS is cleared to gather all stored response bytes and to guard against queue
overflow.
Autopolling Compatibility
You cannot detect the SRQI bit in device status words (ibsta) if you enable Autopolling. The
goal of Autopolling is to remove the SRQ from the IEEE 488 bus, thus preventing visibility of
the SRQI bit in status words for both board calls and device calls. If you choose to look for
SRQI in your program, you must disable Autopolling.
Board functions are also incompatible with Autopolling. The handler disables Autopolling
whenever you make a board call, and re-enables it at the end of a subsequent device call.
Hardware Interrupts and Autopolling
If you have disabled the interrupts of the GPIB interface board via IBCONF or the ibconfig
function, the handler detects SRQ only during calls to the handler, and Autopolling can occur
only at the following events.
During a device ibwait for RQS,
Immediately after a device function has completed and is about to return to the application
program.
If you have enabled hardware interrupts, the handler can respond to SRQI interrupts and perform
Autopolling even when the handler is not performing a function. However, the handler will not
conduct an Autopoll if any of the following conditions exist.