ibsta

Name

ibsta -- holds status

Synopsis

#include <gpib/ib.h>

volatile int ibsta;

Description

ibsta is set whenever a function from the 'traditional' or 'multidevice' API is called. Each of the bits in ibsta has a different meaning, summarized in the following table:

Table 1. ibsta Bits

bitvalue (hexadecimal)meaningused for board/device
DCAS0x1DCAS is set when a board receives the device clear command (that is, the SDC or DCL command byte). It is cleared on the next 'traditional' or 'multidevice' function call following ibwait() (with DCAS set in the wait mask), or following a read or write (ibrd(), ibwrt(), Receive(), etc.). The DCAS and DTAS bits will only be set if the event queue is disabled. The event queue may be disabled with ibconfig().board
DTAS0x2DTAS is set when a board has received a device trigger command (that is, the GET command byte). It is cleared on the next 'traditional' or 'multidevice' function call following ibwait() (with DTAS in the wait mask). The DCAS and DTAS bits will only be set if the event queue is disabled. The event queue may be disabled with ibconfig().board
LACS0x4Board is currently addressed as a listener (IEEE listener state machine is in LACS or LADS).board
TACS0x8Board is currently addressed as talker (IEEE talker state machine is in TACS or TADS).board
ATN0x10The ATN line is asserted.board
CIC0x20Board is controller-in-charge, so it is able to set the ATN line.board
REM0x40Board is in 'remote' state.board
LOK0x80Board is in 'lockout' state.board
CMPL0x100I/O operation is complete. Useful for determining when an asynchronous I/O operation (ibrda(), ibwrta(), etc) has completed.board or device
EVENT0x200One or more clear, trigger, or interface clear events have been received, and are available in the event queue (see ibevent()). The EVENT bit will only be set if the event queue is enabled. The event queue may be enabled with ibconfig().board
SPOLL0x400If this bit is enabled (see ibconfig()), it is set when the board is serial polled. The SPOLL bit is cleared when the board requests service (see ibrsv()) or you call ibwait() on the board with SPOLL in the wait mask. board
RQS0x800RQS indicates that the device has requested service, and one or more status bytes are available for reading with ibrsp(). RQS will only be set if you have automatic serial polling enabled (see ibconfig()).device
SRQI0x1000SRQI indicates that a device connected to the board is asserting the SRQ line. It is only set if the board is the controller-in-charge. If automatic serial polling is enabled (see ibconfig()), SRQI will generally be cleared, since when a device requests service it will be automatically polled and then unassert SRQ.board
END0x2000END is set if the last io operation ended with the EOI line asserted, and may be set on reception of the end-of-string character. The IbcEndBitIsNormal option of ibconfig() can be used to configure whether or not END should be set on reception of the eos character. board or device
TIMO0x4000TIMO indicates that the last io operation or ibwait() timed out.board or device
ERR0x8000ERR is set if the last 'traditional' or 'multidevice' function call failed. The global variable iberr will be set indicate the cause of the error.board or device

If you wish to avoid using a global variable, you may instead use ThreadIbsta() which returns a thread-specific value.