Chapter 5
S Mode Functions
© National Instruments Corp.
5-31
GPIB-232CT User Manual
rd - Read Data *
Type:
I/O
function
Syntax:
rd
#count [addr]
<CR>
Purpose:
You
use
rd
to read data from the GPIB.
Remarks:
The
argument
#count
is a numeric string preceded by a
number sign (
#
).
#count
specifies the number of bytes to
read.
count
must not contain a comma. It can specify a
number between 1 and 65535.
The argument
addr
is a device address that specifies the
address of the device to be addressed as a Talker.
addr
consists of a primary address and a secondary address. The
secondary address is separated from the primary address by a
plus sign (
+
).
Only the lower five bits of each address are significant. These
bits can be in the range from 0 through 30 for both the
primary and the secondary address. Therefore, the binary
value 01100010 (decimal 98) is interpreted as decimal 2.
The following examples all specify a primary address of 0 and
a secondary address of 2. The listen address is 32, the talk
address is 64, and the secondary address is 2 or 98, which are
equivalent.
0+2
or
0+98
or
32+98
or
0+\x62
The GPIB-232CT reads data from the GPIB until the specified
byte count is reached, the GPIB END message is received
with a data byte, the EOS byte is received, or a timeout
occurs.
Because you may not know for certain the number of bytes
actually read from the GPIB, the GPIB-232CT returns the
received GPIB data to you in the following manner. First, the
GPIB-232CT returns to you all bytes it read from the GPIB.
Next, it sends null bytes until the total number of bytes
returned to you matches your requested count. Finally, it
returns a numeric string representing the number of bytes that
it actually read from the GPIB.