RTDX_readNB
2-366
C Interface
Syntax
int RTDX_readNB( RTDX_inputChannel *ichan, void *buffer, int bsize );
Parameters
ichan
/* Identifier for the input data channel */
buffer
/* A pointer to the buffer that receives
the data */
bsize
/* The size of the buffer in address units */
Return Value
RTDX_OK
/* Success.*/
0 (zero)
/* Failure. The target buffer is full. */
RTDX_READ_ERROR /*Channel is currently busy reading. */
Reentrant
yes
Description
RTDX_readNB is a nonblocking form of the function RTDX_read.
RTDX_readNB issues a read request to be posted to the specified input
data channel and immediately returns. If the channel is not enabled or the
channel is currently busy reading, the function returns
RTDX_READ_ERROR. The function returns 0 if it cannot post the read
request due to lack of space in the RTDX target buffer.
When the function RTDX_readNB is used, the target application notifies
the RTDX Host Library that it is ready to receive data but the target
application does not wait. Execution of the target application continues
immediately. Use the RTDX_channelBusy and RTDX_sizeofInput
functions to determine when the RTDX Host Library has written data into
the target buffer.
When RTDX_read is used, the target application notifies the RTDX Host
Library that it is ready to receive data and then waits for the RTDX Host
Library to write data into the target buffer. When the data is received, the
target application continues execution.
Constraints and
Calling Context
❏
RTDX_readNB cannot be called by an HWI function.
See Also
RTDX_channelBusy
RTDX_read
RTDX_sizeofInput
RTDX_readNB
Read from input channel without blocking