IBWAIT(3)

NAME
ibwait - wait for event (board or device)

SYNOPSIS

#include <gpib/ib.h>

int ibwait(int ud, int status_mask);

DESCRIPTION

ibwait() will sleep until one of the conditions specified in status_mask is true. The meaning of the bits in status_mask are the same as the bits of the ibsta status variable.

If status_mask is zero, then ibwait() will return immediately. This is useful if you simply wish to get an updated ibsta.

When calling ibwait() on a device, only the following condition bits in the status_mask are valid: TIMO, END, CMPL, and RQS. For the RQS bit to be set in the returned ibsta automatic serial polling must be enabled for the board controlling the device, see ibconfig(). The RQS condition is cleared by serial polling the device, see ibrsp().

If you wish to resynchronize and obtain the results from an asynchronous I/O operation, you must wait on CMPL by setting its bit in the status_mask parameter. Then if ibwait returns with CMPL set, it will have updated iberr, ibcnt, and the ERR bit of ibsta with the most recent asynchronous I/O results.

If TIMO is set in the status_mask parameter, then ibwait will timeout after the time period set by ibtmo and set TIMO in ibsta.

RETURN VALUE

The value of ibsta is returned.

COPYRIGHT
Copyright © 2003-2006, 2008 Frank Mori Hess