Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-15 NI-488.2 User ManualSRQ and Serial Polling with Device-Level Traditional NI-488.2 CallsYou can use the device-level traditional NI-488.2 call ibrsp to conducta serial poll. ibrsp conducts a single serial poll and returns the serial pollresponse byte to the application. If automatic serial polling is enabled, theapplication can use ibwait to suspend program execution until RQSappears in the status word, ibsta. The program can then call ibrsp toobtain the serial poll response byte.The following example shows you how to use the ibwait and ibrspfunctions in a typical SRQ servicing situation when automatic serial pollingis enabled:#include "ni488.h"char GetSerialPollResponse ( int DeviceHandle ){char SerialPollResponse = 0;ibwait ( DeviceHandle, TIMO | RQS );if ( ibsta & RQS ) {printf ( "Device asserted SRQ.\n" );/* Use ibrsp to retrieve the serial poll response. */ibrsp ( DeviceHandle, &SerialPollResponse );}return SerialPollResponse;}SRQ and Serial Polling with Multi-Device NI-488.2 CallsThe NI-488.2 software includes a set of multi-device NI-488.2 calls thatyou can use to conduct SRQ servicing and serial polling. Calls pertinentto SRQ servicing and serial polling are AllSpoll, ReadStatusByte,FindRQS, TestSRQ, and WaitSRQ. Following are descriptions of each ofthe calls:• AllSpoll can serial poll multiple devices with a single call. It placesthe status bytes from each polled instrument into a predefined array.Then, you must check the RQS bit (bit 6 or hex 40) of each status byteto determine whether that device requested service.• ReadStatusByte is similar to AllSpoll, except that it only serialpolls a single device. It is similar to the device-level NI-488.2 ibrspfunction.