Section Four A BASICA/QuickBASIC GPIB-PC Function Calls©National Instruments Corp. 4A-87 GPIB-PC User ManualBASICA/QuickBASIC BASICA/QuickBASICIBWRT IBWRTPurpose: Write data from stringFormat: 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 bytesof data to a GPIB device. In QuickBASIC, the IBWRTfunction writes from 1 to 32K bytes of data to a GPIBdevice.Device IBWRT Function:When BD% specifies a device, the following board steps are performedautomatically to write to the device:1. The IBCMD function is called to address the device to listenand the access board to talk.2. The board IBWRT function is called to write the data to thedevice, as explained in the following discussion.3. The IBCMD function is called to unaddress the access boardusing the Untalk command and all devices using the Unlistencommand.Other command bytes may be sent as necessary.When the device IBWRT function returns, IBSTA% holds the latestdevice status; IBCNT% is the actual number of data bytes written to thedevice; 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 towrite to a GPIB device that is assumed to already be properly initializedand addressed.If the access board is CIC, the IBCMD function must be called prior toIBWRT 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.