Publication 1756-RM004B-EN-P - October 2000
3-12 MVI Backplane API
Direct I/O Access
MVIbp_ReadOutputImage
Syntax:
int MVIbp_ReadOutputImage(MVIHANDLE handle, WORD *buffer,
WORD offset, WORD length);
Parameters:
handle handle returned by previous call to MVIbp_Open
buffer pointer to buffer to receive data from output image
offset word offset into output image at which to begin reading
length number of words to read
Description:
MVIbp_ReadOutputImage reads from the module’s output image.
handle
must be a valid handle returned from MVIbp_Open.
buffer
must point to a buffer of at least length words in size.
offset
specifies the word in the output image to begin reading, and
length
specifies the number of words to read. The error
MVI_ERR_BADPARAM will be returned if an attempt is made to access
the output image beyond the range configured for direct I/O. See the
MVIbp_SetIOConfig function for more information.
The output image is written by the control processor and read by the
module.
Return Value:
MVI_SUCCESS data read from output image successfully.
MVI_ERR_NOACCESS
handle
does not have access
MVI_ERR_BADPARAM parameter contains invalid value
MVI_ERR_BADCONFIG IO data connection not open (1756-MVI only)
Example:
MVIHANDLE Handle;
WORD buffer[8];
int rc;
/* Read 8 words of data from the output image, starting with word 2 */
rc = MVIbp_ReadOutputImage(Handle, buffer, 2, 8);
if (rc != MVI_SUCCESS)
printf(“ERROR: MVIbp_ReadOutputImage failed”);
See Also:
MVIbp_GetIOConfig, MVIbp_WriteInputImage