IBWRT

NI-488.2

IBWRT

Board-Level/Device-Level


Purpose

Write data to a device from a user buffer.

Format

C

unsigned long ibwrt (int ud, const void *wrtbuf, size_t count)

Visual Basic

CALL ibwrt (ud%, wrtbuf$)

or

status% = ilwrt (ud%, wrtbuf$, count&)

Interactive Control (Usage Notes)

ibwrt wrtbuf

Input

ud Board or device descriptor
wrtbuf Address of the buffer containing the bytes to write
count Number of bytes to be written

Output

Function Return The value of Ibsta

Description

Device-Level

If ud is a device descriptor, ibwrt addresses the GPIB and writes count bytes from the memory location specified by wrtbuf to a GPIB device. The operation terminates normally when count bytes have been sent. The operation terminates with an error if count bytes could not be sent within the timeout period. The actual number of bytes transferred is returned in the global function Ibcnt.

Board-Level

If ud is a board descriptor, ibwrt writes count bytes of data from the buffer specified by wrtbuf to a GPIB device; a board-level ibwrt assumes that the GPIB is already properly addressed. The operation terminates normally when count bytes have been sent. The operation terminates with an error if count bytes could not be sent within the timeout period or, if the board is not CIC, the CIC sends Device Clear on the GPIB. The actual number of bytes transferred is returned in the global function Ibcnt.

Possible Errors

EABO Either count bytes were not sent within the timeout period, or a Device Clear message was received after the write operation began.
EADR Board-level: The GPIB is not correctly addressed; use ibcmd to address the GPIB.
Device-level: A conflict exists between the device GPIB address and the GPIB address of the device access board. Use the IbcPAD and IbcSAD options in ibconfig.
EARG Either the buffer or the count is invalid.
EBUS Device-level: No devices are connected to the GPIB.
ECIC Device-level: The access board is not CIC. See Device-Level Calls and Bus Management.
EDVR The NI-488.2 driver is either configured incorrectly or is not properly installed.
EHDL ud is invalid or out of range.
ELCK The requested operation could not be performed because of an existing lock by another process.
ENEB The interface is not installed or is not properly configured.
ENOL No Listeners were detected on the bus.
EOIP Asynchronous I/O is in progress.