AlazarAsyncRead¶
Function Syntax¶
-
RETURN_CODE
AlazarAsyncRead
(HANDLE handle, void * buffer, U32 bytesToRead, OVERLAPPED * overlapped)¶ Adds a buffer to the end of a list of available buffers to be filled by the board. When the board receives sufficient trigger events to fill the buffer, the event in the
OVERLAPPED
will be set to the signaled state.You must call AlazarBeforeAsyncRead() before calling AlazarAsyncRead().
The
bytesToRead
parameter must be equal to the product of the number of bytes per record, the number of recods per buffer and the number of enabled channels. If record headers are enabled, the number of bytes per record must include the size of the record header (16 bytes).- Return
- If the function succeeds in adding the buffer to end of the list of buffers available to be filled by the board, it returns ApiDmaPending. When the board fills the buffer, the event in the OVERLAPPED structure is set to the signaled state.
- Return
- If the function fails because the board overflowed its on board memory, it 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 it is transferring data from on-board memory to host memory. If this is the case, try reducing the sample rate, number of enabled channels, or amount of time spent processing each buffer.
- Return
- If the function fails because the buffer is too large for the driver or operating system to prepare for scatter-gather DMA transfer, it returns ApiLockAndProbePagesFailed. Try reducing the size of each buffer, or reducing the number of buffers queued by the application.
- 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
- AlazarAsyncRead() is only available under Windows
- Warning
- You must call AlazarAbortAsyncRead() before your application exits if you have called AlazarAsyncRead() and buffers are pending.
- Parameters
handle
: Handle to boardbuffer
: Pointer to a buffer to receive sample data from the digitizer boardbytesToRead
: Number of bytes to read from the boardoverlapped
: Pointer to anOVERLAPPED
structure. The event in thestructure is set to the signaled state when the read operation completes.