RTDX_read
Application Program Interface
2-365
C Interface
Syntax
int RTDX_read( 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
> 0
/* The number of address units of data */
/* actually supplied in buffer. */
0
/* Failure. Cannot post read request */
/* because target buffer is full. */
RTDX_READ_ERROR
/* Failure. Channel currently busy or
not enabled. */
Reentrant
yes
Description
RTDX_read causes a read request to be posted to the specified input
data channel. If the channel is enabled, RTDX_read waits until the data
has arrived. On return from the function, the data has been copied into
the specified buffer and the number of address units of data actually
supplied is returned. The function returns RTDX_READ_ERROR
immediately if the channel is currently busy reading or is not enabled.
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 to the target buffer. When the data is received, the
target application continues execution.
The specified data is to be written to the specified output data channel,
provided that channel is enabled. On return from the function, the data
has been copied out of the specified user buffer and into the RTDX target
buffer. If the channel is not enabled, the write operation is suppressed. If
the RTDX target buffer is full, failure is returned.
When 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
RTDX_channelBusy and RTDX_sizeofInput to determine when the
RTDX Host Library has written data to the target buffer.
Constraints and
Calling Context
❏
RTDX_read cannot be called by an HWI function.
See Also
RTDX_read
Read from an input channel