IBCMDA

NI-488.2

IBCMDA

Board-Level


Purpose

Send GPIB commands asynchronously.

Format

C

unsigned long ibcmda (int ud, const void *cmdbuf, size_t count)

Visual Basic

CALL ibcmda (ud%, cmdbuf$)

or

status% = ilcmda (ud%, cmdbuf$, count&)

Interactive Control (Usage Notes)

ibcmda cmdbuf

Input

ud A board unit descriptor
cmdbuf Buffer of command bytes to send
count Number of command bytes to send

Output

Function Return The value of Ibsta

Description

ibcmda sends count bytes from cmdbuf over the GPIB as command bytes (interface messages). The number of command bytes transferred is returned in the global function, Ibcnt. Refer to the list of IEEE 488 command messages for defined interface messages.

Command bytes are used to configure the state of the GPIB. They are not used to send instructions to GPIB devices. Use ibwrt to send device-specific instructions.

The asynchronous I/O calls (ibcmda, ibrda, ibwrta ) are designed so that applications can perform other non-GPIB operations while the I/O is in progress. Once the asynchronous I/O begins, further NI-488.2 calls are strictly limited. Any calls that would interfere with the I/O in progress are not allowed; the driver returns EOIP in this case.

Once the I/O is complete, the application must resynchronize with the NI-488.2 driver. Resynchronization is accomplished by using one of the following calls:

ibwait If the returned Ibsta contains CMPL, the driver and application are resynchronized.
ibnotify If the Ibsta value passed to the ibnotify callback contains CMPL, the driver and application are resynchronized.
ibstop The I/O is canceled; the driver and application are resynchronized.
ibonl The I/O is canceled and the interface is reset; the driver and application are resynchronized.

Possible Errors

ECIC The interface is not Controller-In-Charge.
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 are on the GPIB.
EOIP Asynchronous I/O is in progress.