ThreadIbsta

int ThreadIbsta (void);

Purpose

Returns the value of the thread-specific ibsta variable for the current thread.

The global variables ibsta, iberr, ibcnt, and ibcntl are maintained on a process-specific rather than a thread-specific basis. If you call GPIB functions in more than one thread, the values in these global variables are not always reliable.

Status variables analogous to ibsta, iberr, ibcnt, and ibcntl are maintained for each thread. ThreadIbsta returns the value of the thread-specific ibsta variable.

If you do not use multiple threads, ThreadIbsta returns a value identical to the value of the ibsta global variable.

Parameters

None.

Return Value

Name Type Description
threadSpecificStatus integer Status value for the current thread of execution. The status value describes the state of the GPIB and the result of the most recent GPIB function call in the thread. Any value with the ERR bit set indicates an error. Call ThreadIberr for a specific error code.

Return Codes

The return value is a sum of the following bits.

Defined Constant Hex Value Description
ERR 8000 GPIB error.
END 2000 END or EOS detected.
SRQI 1000 SRQ is on.
RQS 800 Device requesting service.
CMPL 100 I/O completed.
LOK 80 GPIB-PC in lockout state.
REM 40 GPIB-PC in remote state.
CIC 20 GPIB-PC is Controller-In-Charge.
ATN 10 Attention is asserted.
TACS 8 GPIB-PC is talker.
LACS 4 GPIB-PC is listener.
DTAS 2 GPIB-PC in device trigger state.
DCAS 1 GPIB-PC in device clear state.

See Also

ThreadIberr, ThreadIbcnt, ThreadIbcntl