Example 2 - National Instruments NI-488.2M Software Reference Manual

For os/2
Hide thumbs Also See for NI-488.2M:
Table of Contents

Advertisement

GPIB Programming Techniques
/* 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",
*DevicePad = AddrList[ibcnt];
*DeviceResponse = SerialPollResponse;
}
}
return;
}

Example 2

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" );
/* Use Allspoll to serial poll all the devices at once.*/
AllSpoll ( 0, AddrList, ResponseList );
if (!(ibsta & ERR))
for ( i = 0; AddrList[i] != NOADDR; i++ )
printf("Device at pad %x returned byte %x.\n",
}
}
}
return;
}
NI-488.2M SRM for OS/2
{
AddrList[ibcnt], (int)SerialPollResponse);
{
AddrList[i], ResponseList[i] );
6-8
© National Instruments Corp.
Chapter 6
{

Advertisement

Table of Contents
loading

Table of Contents