iblock

int iblock (int boardDevice);

Purpose

Blocks other processes from accessing the specified GPIB-ENET board or device. You can release the lock by calling ibunlock with the same board or device descriptor.

By default, a process returns an ELCK (21) error when it attempts to use a board or device locked by another process. You can cause your process to block instead of returning an error by making the following function call:

ibconfig (boardOrDevice, IbcBlockIfLocked, 1);

There is no timeout on the process that remains in a blocked state.

In general, you should use iblock to gain critical access to a GPIB-ENET board or device when multiple processes might be accessing it at the same time. When the GPIB-ENET is locked, the GPIB driver guarantees that subsequent calls you make to the GPIB-ENET are completed without interruption.

Parameters

Input
Name Type Description
boardDevice integer Device descriptor you obtain from OpenDev, ibfind, or ibdev.

Return Value

Name Type Description
status integer Indicates whether the function succeeded.

See Also

ibunlock