Ibrd, Ibrd -34 – Measurement Computing GPIB-488 User Manual
Page 47

Chapter 3
GPIB 488.1 Library Reference
3-34
GPIB-488
IBRD
Reads data from a device/interface board into a string.
Syntax
C
ibrd (int boarddev, char buf[], unsigned long
bytecount)
Parameters
boarddev
is an integer containing the board or device handle.
buf
is the storage buffer for the data. Up to 4 gigabytes-1 (2
32
-1 bytes) can be stored. String
size may be limited by the language you are using. Check documentation for your language.
bytecount
specifies the maximum number of bytes to read.
Returns
ibsta
will contain a 16-bit status word as described in Appendix B,
.
iberr
will contain an error code of the first error detected, if an error occurred. An
EADR
results if the specified GPIB Interface Board is an Active Controller but has not been
addressed to listen. An
EABO
error results if a timeout occurs.
ibcnt
,
ibcntl
will contain the number of bytes that were read.
ibcnt
is a 16-bit integer.
ibcntl
is a 32-bit integer. If the requested count was greater than 64 K, use
ibcntl
instead
of
ibcnt
.
Usage Notes
A read will terminate when one of the following occurs:
•
The allocated buffer becomes full.
•
An error is detected.
•
The time limit is exceeded.
•
A terminator (or EOI) is detected.
If
boarddev
specifies a device, the specified device is addressed to talk and its associated
access board is addressed to listen.
If
boarddev
specifies a GPIB Interface board, you must have already addressed a device as
a talker and the board as a listener. If the board is the Active Controller, it will unassert ATN
in order to receive data. This routine leaves the board in that state.