Example 1: Using Findrqs - National Instruments NI-488.2 NI-488.2 User Manual

National instruments network hardware - networking hardware user manual
Hide thumbs Also See for NI-488.2 NI-488.2:
Table of Contents

Advertisement

Chapter 8
NI-488.2 Programming Techniques
NI-488.2 User Manual
serial polls a list of devices until it finds a device that is
FindRQS
requesting service or until it has polled all of the devices on the list.
The call returns the index and status byte value of the device requesting
service.
determines whether the SRQ line is asserted and returns to
TestSRQ
the program immediately.
is similar to
WaitSRQ
application until either SRQ is asserted or the timeout period is
exceeded.
The following examples use these calls to detect SRQ and then determine
which device requested service. In these examples, three devices are
present on the GPIB at addresses 3, 4, and 5, and the GPIB interface is
designated as bus index 0. The first example uses
which device is requesting service, and the second example uses
to serial poll all three devices. Both examples use
GPIB SRQ line to be asserted.

Example 1: Using FindRQS

This example shows you how to use
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;
}
, except that
TestSRQ
FindRQS
{
8-16
suspends the
WaitSRQ
to determine
FindRQS
AllSpoll
to wait for the
WaitSRQ
to find the first device that
ni.com

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents