Example 1: Using FindRQS

NI-488.2

Example 1: Using FindRQS

This example shows you how to use FindRQS to find the first device that 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");
      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;
}