Receivesetup, Receivesetup -16 – Measurement Computing GPIB-488 User Manual
Page 84

Chapter 4
GPIB 488.2 Library Reference
4-16
GPIB-488
ReceiveSetup
Address a GPIB Interface Board as a Listener and a GPIB device as a Talker, in preparation
for data transmission.
Syntax
C
ReceiveSetup(int board, short address)
Parameters
board
is an integer which identifies the GPIB board to be used for this operation. In most
applications, this value is 0.
address
is an integer representing the GPIB address of the device to send the data.
Returns
ibsta
will contain a 16-bit status word as described in Appendix B,
.
iberr
will contain an error code, if an error occurred.
Usage Notes
In order to actually transfer any data, you must call a routine such as
RcvRespMsg
following
this routine.
This routine is useful in instances where you need to transfer multiple blocks of data between
devices. For example, you could initially address the devices using
ReceiveSetup
, then
make multiple calls of
RcvRespMsg
to transfer the data.
For typical cases,
Receive
is simpler to use, since it takes care of both the setup and the data
transfer.
Example
This example instructs a GPIB device at address 5 to send data to GPIB Board 0. Up to 50
bytes of data is received and then stored in a string. The message is terminated with an EOI.
C
char message[100];
ReceiveSetup(0, 5);
RcvRespMsg (0, message, 50, STOPend);