# ThreadIberr

int ThreadIberr (void);

## Purpose

Returns the value of the thread-specific iberr 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. ThreadIberr returns the value of the thread-specific iberr variable.

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

## Parameters

None.

## Return Value

Name | Type | Description
--- | --- | ---
threadSpecificError | integer | Most recent GPIB error code for the current thread of execution. The value is meaningful only when ThreadIbsta returns a value with the ERR bit set.

## Return Codes

Defined Constant | Value | Description
EDVR | 0 | Operating system error. ThreadIbcntl returns the system-specific error code.
ECIC | 1 | Function requires GPIB-PC to be Controller-In-Charge (CIC).
ENOL | 2 | No listener on write function.
EADR | 3 | GPIB-PC addressed incorrectly.
EARG | 4 | Invalid function call argument.
ESAC | 5 | GPIB-PC not system controller as required.
EABO | 6 | I/O operation aborted.
ENEB | 7 | Non-existent GPIB-PC interface.
EDMA | 8 | Virtual DMA device error.
EOIP | 10 | I/O started before previous operation completed.
ECAP | 11 | Unsupported feature.
EFSO | 12 | File system error.
EBUS | 14 | Command error during device call.
ESTB | 15 | Serial poll status byte lost.
ESRQ | 16 | SRQ stuck in the asserted state.
ETAB | 20 | Device list error during a FindLstn or FindRQS call.
ELCK | 21 | Address or board is locked.
ELNK | 200 | The GPIB library was not linked. Dummy functions were linked instead.
EDLL | 201 | Error loading gpib-32.dll. ThreadIbcntl returns the Windows error code.
EFNF | 203 | Unable to find the function in gpib-32.dll. ThreadIbcntl returns the Windows error code.
EGLB | 205 | Unable to find globals in gpib-32.dll. ThreadIbcntl returns the Windows error code.
ENNI | 206 | Not a National Instruments gpib-32.dll.
EMTX | 207 | Unable to acquire mutex for loading DLL. ThreadIbcntl returns the Windows error code.
EMSG | 210 | Unable to register callback function with Windows.
ECTB | 211 | The callback table is full.

## See Also

ThreadIbsta, ThreadIbcnt, ThreadIbcntl