Example 2: Using AllSpoll

NI-488.2

Example 2: Using AllSpoll

This example shows you how to use AllSpoll to serial poll three devices with a single call.

void GetAllSerialPollResponses ( Addr4882_t AddrList[],
                                 short ResponseList[] )
{
   int WaitResult;
   WaitSRQ (0, &WaitResult);
   if ( WaitResult ) {
      printf ( "SRQ is asserted.\n" );
      AllSpoll ( 0, AddrList, ResponseList );
      if (!(Ibsta() & ERR))  {
         for (i = 0; AddrList[i] != NOADDR; i++)  {
            printf ("Device at pad %x returned byte %x.\n",
               AddrList[i],
               ResponseList[i] );
         }
      }
   }
   return;
}