Direct i/o access – ProSoft Technology MVI69E-LDM User Manual
Page 73

MVI69E-LDM ♦ "C" Programmable
Contents
Linux Application Development Module
Developer's Manual
ProSoft Technology, Inc.
Page 73 of 130
August 21, 2014
5.2
Direct I/O Access
MVI69_ReadOutputImage
Syntax
int MVI69_ReadOutputImage (MVI69HANDLE handle,
WORD offset,
WORD length,
WORD *buffer);
Parameters
handle
handle returned by previous call toMVI69_Open
offset
word offset into output image at which to begin reading
length
number of words to read
buffer
pointer to buffer to receive data from output image
Description
MVI69_ReadOutputImage reads from the module's output image.
handle
must be a valid handle returned from
MVI69_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 MVI69_ERR_BADPARAM will be returned if an attempts
is made to access the output image beyond the range configured for direct IO. See the
MVI69_GetIOConfig
and
MVI69_SetIOConfig
functions for more information.
The output image is written by the control processor and read by the module.
Return Value
MVI69_SUCCESS
data was read from the output image successfully
MVI69_ERR_NOACCESS
handle does not have access
MVI69_ERR_BADPARAM
Parameter contains invalid value
Example
MVI69HANDLE handle;
WORD buffer[8];
int rc;
/* Read 8 words of data from the output image, starting with word 2*/
rc = MVI69_ReadOutputImage (Handle, 2, 8, buffer);
if (rc != MVI69_SUCCESS)
printf("ERROR: MVI69_ReadOutputImage failed");
See Also
MVI69_GetIOConfig
MVI69_SetIOConfig
MVI69_WriteInputImage