Download NI-488.2M Software Reference Manual
Transcript
Chapter 4
NI-488.2M Software Characteristics and Routines
FindLstn (3)
FindLstn (3)
Purpose:
Find all Listeners.
Syntax:
void FindLstn (int board, Addr4882_t addresslist [ ] ,
Addr4882_t resultlist [ ] , int limit)
board specifies a board number. addresslist contains a list of
primary GPIB addresses, terminated by the value NOADDR. These
addresses are tested in turn for the presence of a listening device. If found,
the addresses are entered into the resultlist. If no listening device is
detected at a particular primary address, all the secondary addresses
associated with that primary address are tested, and detected Listeners are
entered into resultlist. The limit argument specifies how many
entries should be placed into the resultlist array. If more Listeners
are present on the bus, the list is truncated after limit entries have been
detected, and the error ETAB will be reported in iberr. The variable
ibcnt will contain the number of addresses placed into resultlist.
Because for any given primary address there may be multiple secondary
addresses that respond as Listeners, the resultlist array should, in
general, be larger than the addresslist array. In any event, the
resultlist (with limit being the maximum possible results) array
must be large enough to accommodate all expected listening devices
because no check is made for overflow of the array.
Because most GPIB devices have the ability to listen, this routine is
normally used to detect the presence of devices at particular addresses.
Once detected, they usually can be interrogated by identification messages
to determine what devices they are.
Example:
Determine which one of the devices at addresses 8, 9, and 10 are
present on the GPIB.
Addr4882_t addresslist[4] = {8, 9, 10, NOADDR};
Addr4882_t resultlist[5];
FindLstn (0, addresslist, resultlist, 5);
© National Instruments Corp.
4-13
NI-488.2M Reference Manual