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.
Return

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

Return

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

Return

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.

Return

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

Return

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

Return

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.

Remark

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

Warning

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

Parameters
  • [in] handle: Handle to board

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

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

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().