Chapter 7 NI-488.2 Programming Techniques© National Instruments Corporation 7-13 NI-488.2 User Manual for WindowsAutomatic Serial PollingYou can enable automatic serial polling if you want your application toconduct a serial poll automatically when the SRQ line is asserted. Theautopolling procedure occurs as follows:1. To enable autopolling, use the configuration function, ibconfig, withoption IbcAUTOPOLL, or the NI-488.2 Configuration utility.(Autopolling is enabled by default.)2. When the SRQ line is asserted, the driver automatically serial polls theopen devices.3. Each positive serial poll response (bit 6 or hex 40 is set) is stored in aqueue associated with the device that sent it. The RQS bit of the devicestatus word, ibsta, is set.4. The polling continues until SRQ is unasserted or an error condition isdetected.5. To empty the queue, use the ibrsp function. ibrsp returns the firstqueued 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 iscalled, a serial poll is conducted and returns the response received.Empty the queue as soon as an automatic serial poll occurs, becauseresponses might be discarded if the queue is full.6. If the RQS bit of the status word is still set after ibrsp is called, theresponse byte queue contains at least one more response byte. If thishappens, continue to call ibrsp until RQS is cleared.Stuck SRQ StateIf autopolling is enabled and the GPIB interface detects an SRQ, the driverserial polls all open devices connected to that interface. The serial pollcontinues until either SRQ unasserts or all the devices have been polled.If no device responds positively to the serial poll, or if SRQ remains ineffect because of a faulty instrument or cable, a stuck SRQ state is in effect.If this happens during an ibwait for RQS, the driver reports the ESRQerror. If the stuck SRQ state happens, no further polls are attempted until anibwait for RQS is made. When ibwait is issued, the stuck SRQ state isterminated and the driver attempts a new set of serial polls.