AlazarWaitNextAsyncBufferComplete(HANDLE handle, void *buffer, U32 bytesToCopy, U32 timeout_ms)¶
This function returns when the board has received sufficient trigger events to fill the buffer, or the timeout interval has elapsed.
You must callAlazarBeforeAsyncRead() with the ADMA_GET_PROCESSED_DATA flag before calling AlazarWaitNextAsyncBufferComplete().
If the board receives sufficient trigger events to fill the next available buffer before the timeout interval elapses, and the buffer is not the last buffer in the acquisition, the function returns ApiSuccess.
If the board receives sufficient trigger events to fill the next available buffer before the timeout interval elapses, and the buffer is the last buffer in the acquisition, the function returns ApiTransferComplete.
If the timeout interval elapses before the board receives sufficient trigger events to fill the next available buffer, the function returns ApiWaitTimeout.
If the board overflows its on-board memory, the function returns ApiBufferOverflow. The board may overflow its on-board memory because the rate at which it is acquiring data is faster than the rate at which the data is being transferred from on-board memory to host memory across the host bus interface (PCI or PCIe). If this is the case, try reducing the sample rate, number of enabled channels, or amount of time spent processing each buffer.
If the function fails for some other reason, it returns an error code that indicates the reason that it failed.
[in] handle: Handle to board
[out] buffer: Pointer to a buffer to receive sample data from the digitizer board.
[in] bytesToCopy: The number of bytes to copy into the buffer
[in] timeout_ms: The time to wait for the buffer to buffer to be filled, in milliseconds.
To discard buffers, set the bytesToCopy parameter to zero. This will cause AlazarWaitNextAsyncBufferComplete() to wait for a buffer to complete, but not copy any data into the application buffer.
To enable disk streaming using high-performance disk I/O functions, call AlazarCreateStreamFile() before calling AlazarWaitNextAsyncBufferComplete(). For best performance, set the bytesToCopy parameter to zero so that data is streamed to disk without making any intermediate copies in memory.
AlazarBeforeAsyncRead() can be called with the ADMA_GET_PROCESSED_DATA flag. In this case, AlazarWaitNextAsyncBuferComplete() will process buffers so that the data layout is always not interleaved (i.e. R1A, R2A, … RnA, R1B, R2B, … RnB with RXY record X of channel Y). This may simplify application development, but it comes at the expense of added processing time for each buffer.