Chapter 7
NI-488.2 Programming Techniques
NI-488.2 User Manual for Windows
Example 1: Using FindRQS
This example shows you how to use
is requesting service:
void GetASerialPollResponse ( char *DevicePad,
{
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;
}
Example 2: Using AllSpoll
This example shows you how to use
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
}
}
}
FindRQS
char *DeviceResponse )
{
AllSpoll
{
%x.\n", AddrList[i], ResponseList[i] );
7-16
to find the first device that
to serial poll three devices
www.natinst.com
{