Section Four A
BASICA/QuickBASIC GPIB-PC Function Calls
©National Instruments Corp.
4A-87
GPIB-PC User Manual
BASICA/QuickBASIC
BASICA/QuickBASIC
IBWRT
IBWRT
Purpose:
Write data from string
Format:
CALL IBWRT (BD%,WRT$)
Remarks:
BD%
specifies a device or an interface board.
WRT$
contains the data to be sent over the GPIB.
In BASICA, the
IBWRT
function writes from 1 to 255 bytes
of data to a GPIB device. In QuickBASIC, the
IBWRT
function writes from 1 to 32K bytes of data to a GPIB
device.
Device
IBWRT
Function:
When
BD%
specifies a device, the following board steps are performed
automatically to write to the device:
1.
The
IBCMD
function is called to address the device to listen
and the access board to talk.
2.
The board
IBWRT
function is called to write the data to the
device, as explained in the following discussion.
3.
The
IBCMD
function is called to unaddress the access board
using the Untalk command and all devices using the Unlisten
command.
Other command bytes may be sent as necessary.
When the device
IBWRT
function returns,
IBSTA%
holds the latest
device status;
IBCNT%
is the actual number of data bytes written to the
device; and
IBERR%
is the first error detected if the ERR bit in
IBSTA%
is set.
Board
IBWRT
Function:
When
BD%
specifies an interface board, the
IBWRT
function attempts to
write to a GPIB device that is assumed to already be properly initialized
and addressed.
If the access board is CIC, the
IBCMD
function must be called prior to
IBWRT
to address the device to listen and the board to talk. Otherwise,
the device on the GPIB that is the CIC must perform the addressing.