AlazarWaitAsyncBufferComplete#

Function Syntax#

RETURN_CODE AlazarWaitAsyncBufferComplete(HANDLE handle, void *buffer, U32 timeout_ms)#

This function returns when a board has received sufficient triggers to fill the specified buffer, or when the timeout internal elapses.

Each call to AlazarPostAsyncBuffer() adds a buffer to the end of a list of buffers to be filled by the board. AlazarWaitAsyncBufferComplete() expects to wait on the buffer at the head of this list. As a result, you must wait for buffers in the same order than they were posted.

Remark

You must call AlazarBeforeAsyncRead() and AlazarPostAsyncBuffer() before calling AlazarWaitAsyncBufferComplete().

When AlazarWaitAsyncBufferComplete() returns ApiSuccess, the buffer is removed from the list of buffers to be filled by the board.

The arrangement of sample data in each buffer depends on the AutoDMA mode specified in the call to AlazarBeforeAsyncRead().

Warning

You must call AlazarAbortAsyncRead() before your application exits if your have called AlazarPostAsyncBuffer() and buffers are pending.

Parameters
  • handle[in] Handle to board

  • buffer[out] Pointer to a buffer to receive sample data form the digitizer board

  • timeout_ms[in] The time to wait for the buffer to be filled, in milliseconds.

Returns

If the board receives sufficient trigger events to fill this buffer before the timeout interval elapses, the function returns ApiSuccess.

Returns

If the timeout interval elapses before the board receives sufficient trigger events to fill the buffer, the function returns ApiWaitTimeout.

Returns

If the board overflows its on-board memory, the function returns ApiBufferOverflow. This happens if the rate at which data is acquired is faster than the rate at which data is being transferred from on-board memory to host memory across the host bus interface.

Returns

If this buffer was not found in the list of buffers available to be filled by the board, the function returns ApiBufferNotReady.

Returns

If this buffer is not the buffer at the head of the list of buffers to be filled by the board, this returns ApiDmaInProgress.

Returns

If the function fails for some other reason, it returns an error code that indicates the reason that it failed. See RETURN_CODE for more information.