Platform specific functions – ProSoft Technology MVI69-ADM User Manual
Page 230

Backplane API Functions
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 230 of 342
ProSoft Technology, Inc.
February 20, 2013
8.7
Platform Specific Functions
MVIbp_ReadModuleFile (MVI46)
Syntax
int MVIbp_ReadModuleFile(MVIHANDLE handle, BYTE filetype, WORD *filedata, WORD
offset, WORD len);
Parameters
handle
Handle returned by previous call to MVIbp_Open
filetype
Type of module file to read, M0 or M1
filedata
Pointer to buffer to receive data
offset
Word offset into the module file to begin reading
len
Number of words to read
Description
MVIbp_ReadModuleFile reads data from the M0 or M1 file of the module. This
function can only be used when the module is configured as a Class 4 module.
handle must be a valid handle returned from MVIbp_Open.
The type of file to be read is determined by the value in filetype, which should be
set to FILTYP_M0 or FILTYP_M1.
This function reads len words starting at word offset of the module file and copies
the data to the buffer pointed to by filedata, which must be len words in size. The
error MVI_ERR_BADPARAM will be returned if an attempt is made to access the
module file beyond the range configured for module file. If this error is returned,
no data will be read from the module file.
Note: This function provides data integrity in blocks of 64 Words as the data is copied.
Note: Because Messaging uses module files, MVIbp_ReadModuleFile should not be used while
Messaging is used.
Note: At this time, messaging is not supported on the MVI69.
Return Value
MVI_SUCCESS
The module file data was read successfully.
MVI_ERR_NOACCESS
handle does not have access
MVI_ERR_BADPARAM
Invalid parameter
MVI46_ERR_INVALIDCLASS
The module is not Class 4
Example
MVIHANDLE Handle;
WORD buffer[10];
/* Read the first 10 words of the M1 file */
MVIbp_ReadModuleFile(Handle,FILTYP_M1, &buffer[0], 0, 10);