Model 4200A-SCS Parameter Analyzer Reference Manual
Section 13: LPT library function reference
4200A-901-01 Rev. C / February 2017
13-25
kibrcv
This command reads a device-dependent string from an instrument connected to the GPIB interface.
Usage
int kibrcv(int
pri_addr
, int
sec_addr
, char
term
, unsigned int
timeout
, unsigned
int
rcv_size
, unsigned int *
rcv_len
, char *
rcv_buff
);
pri_addr
The primary address of the instrument (0 to 30; the controller uses address 31)
sec_addr
The secondary address of the instrument (1 to 30; if the instrument device does not
support secondary addressing, this parameter must be -1)
term
The ASCII delimiter character of the returned string; this is the byte used for
terminating data buffer reading
timeout
The GPIB timeout for the transfer in 100 ms units (for example,
timeout = 40 = 4.0 s)
rcv_size
The physical receive buffer size; this is the maximum number of bytes that can be
read from the device
rcv_len
The number of bytes that are read from the device on the GPIB interface; this
variable is returned by the tester after all bytes are read from the device
rcv_buff
The physical byte buffer destined to receive the data from the device connected to
the GPIB interface
Details
The
kibrcv
command receives a buffer from the GPIB interface by doing the following:
1. Assert attention (ATN).
2. Send device LISTEN address.
3. Send device TALK address.
4. Send secondary address (if not -1).
5. De-assert ATN.
6. Read byte array from the device
rcv_buff
parameter until end-or-identify (EOI) or the delimiter
is received.
7. Assert ATN.
8. Send UNTalk (UNT).
9. Send UNListen (UNL).
10. De-assert ATN.
The
rcv_size
parameter defines the maximum number of bytes physically allowed in the buffer. If
the
rcv_size
parameter is greater than the byte string returned by the instrument, the device is
short-cycled and only the maximum number of bytes is returned.
Also see
None