Ibln, Ibln -27 – Measurement Computing GPIB-488 User Manual

Page 40

Advertising
background image

Chapter 3

GPIB 488.1 Library Reference

GPIB-488

3-27

Programming Reference Manual

IBLN

Check that a device is present on the bus.

Syntax

C

ibln (int board, int pad, int sad, short* listen)

Parameters

board

is the board or device handle.

pad

is the primary address of the GPIB device (0-30).

sad

is the secondary address of the GPIB device (96-126 or 0x60-0x7e) or one of the constant

values NO_SAD or ALL_SAD.

listen

is the variable that the result is returned to.

Returns

ibsta

will contain a 16-bit status word as described in Appendix B,

IBSTA

.

iberr

will contain an error code if an error occurred.

listen

will contain 0 if no listener is found. Contains non-zero if a listener is found.

Usage Notes

Set

sad

= NO_SAD (0) if the device does not have a secondary address.

Set

sad

= ALL_SAD (-1) if you do not know the device’s secondary address and you want

all possible secondary addresses to be tested.

Example

This example tests for the presence of a device with a GPIB address of 4.

C

int board, listen;

board = ibfind (“GPIB0”);

ibln (board, 4, NO_SAD, &listen);

Advertising