ProSoft Technology MVI69-ADM User Manual

Page 231

Advertising
background image

MVI-ADM ♦ 'C' Programmable

Backplane API Functions

'C' Programmable Application Development Module

Developer's Guide

ProSoft Technology, Inc.

Page 231 of 342

February 20, 2013

MVIbp_WriteModuleFile (MVI46)

Syntax

int MVIbp_WriteModuleFile(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 write, M0 or M1

filedata

Pointer to buffer of data to write to the module file

offset

Word offset into the module file to begin writing

len

Number of words to write

Description
MVIbp_WriteModuleFile writes data to 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 written is determined by the value in filetype, which should
be set to FILTYP_M0 or FILTYP_M1.

This function writes len words from the buffer pointed to by filedata to the module
file starting at WORD offset. The buffer 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 written to 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_WriteModuleFile 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[2];
/* write 2 words to words 5 and 6 of the M0 file */
buffer[0] = 12;
buffer[1] = 34;
MVIbp_WriteModuleFile(Handle,FILTYP_M0, &buffer[0], 5, 2);

Advertising