例2: AllSpollを使用する

NI-488.2

例2: AllSpollを使用する

この例では、AllSpollを使って、1回のコールで3つのデバイスに対してシリアルポールを行う方法を示します。

void GetAllSerialPollResponses ( Addr4882_t AddrList[],
                                 short ResponseList[] )
{
   int WaitResult;
   WaitSRQ (0, &WaitResult);
   if (WaitResult) {
      printf ( "SRQ がアサ−トされています。\n" );
      AllSpoll ( 0, AddrList, ResponseList );
if (!(Ibsta() & ERR)){
         for (i = 0; AddrList[i] != NOADDR; i++)  {
         printf ("pad%xのデバイスがバイト%xを返しました。\n",
               AddrList[i],
               ResponseList[i] );
         }
      }
   }
return;
}