
BASICA/QuickBASIC GPIB-PC Function Calls Section Four A
GPIB-PC User Manual 4A-50 ©National Instruments Corp.
BASICA/QuickBASIC BASICA/QuickBASIC
IBRDA IBRDA
Purpose: Read data asynchronously to string
Format: CALL IBRDA (BD%,RD$)
Remarks: BD% specifies a device or an interface board. RD$
identifies the storage buffer for data bytes that are read
from the GPIB.
The IBRDA function reads from 1 to 255 bytes of data from
a GPIB device. In QuickBASIC the IBRDA function reads
from 1 to 32K bytes of data from a GPIB device.
IBRDA is used in place of IBRD when the application
program must perform other functions while processing the
GPIB I/O operation. IBRDA returns after starting the I/O
operation. If the number of bytes to read is small and the
bytes are transmitted quickly by the GPIB device, the
operation may complete on the initial call. In this case,
the CMPL bit will be set in IBSTA%. If the operation does
not complete on the initial call, you should monitor the
IBSTA% variable after subsequent calls (usually IBWAIT
calls) to know that the I/O is completed. When CMPL
becomes set in IBSTA%, indicating that the I/O is
complete, the number of bytes read is reported in the
IBCNT% variable.
Device IBRDA Function:
When BD% specifies a device, the following board steps are performed
automatically to read from the device:
1. The IBCMD function is called to address the device to talk and
the access board to listen.
2. The board IBRDA function is called to read the data from the
device, as explained in the following discussion.
Other command bytes may be sent as necessary.
When the device IBRDA function returns, IBSTA% holds the latest
device status; IBERR% is the first error detected, if the ERR bit in
IBSTA% is set.