Chapter 7 GPIB Programming Techniques
© National Instruments Corp. 7-9 NI-488.2 User Manual for Windows
Example 1: Using FindRQS
This example illustrates the use of FindRQS to determine which device is requesting
service.
void GetASerialPollResponse ( char *DevicePad,
char *DeviceResponse )
{
char SerialPollResponse = 0;
int WaitResult;
Addr4882_t Addrlist[4] = {3,4,5,NOADDR};
WaitSRQ (0, &WaitResult);
if (WaitResult) {
printf ("SRQ is asserted.\n");
/* Use FindRQS to find a device that requested service. */
FindRQS ( 0, AddrList, &SerialPollResponse );
if (!(ibsta & ERR)) {
printf ("Device at pad %x returned byte %x.\n",
AddrList[ibcnt],(int) SerialPollResponse);
*DevicePad = AddrList[ibcnt];
*DeviceResponse = SerialPollResponse;
}
}
return;
}
Example 2: Using AllSpoll
This example illustrates the use of AllSpoll to serial poll three devices.
void GetAllSerialPollResponses ( Addr4882_t AddrList[], short
ResponseList[] )
{
int WaitResult;
WaitSRQ (0, &WaitResult);
if ( WaitResult ) {
printf ( "SRQ is asserted.\n" );