Backplane api direct i/o access – ProSoft Technology MVI69-ADM User Manual

Page 214

Advertising
background image

Backplane API Functions

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 214 of 342

ProSoft Technology, Inc.

February 20, 2013

8.4

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. Refer to 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

The data was read from the output image successfully.

MVI_ERR_NOACCESS

handle does not have access

MVI_ERR_BADPARAM

Parameter contains invalid value

MVI_ERR_BADCONFIG

the data connection is not open (MVI46 and MVI56 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_SetIOConfig (page 208)

MVIbp_WriteInputImage (page 215)

Advertising