ProSoft Technology MVI69-ADM User Manual

Page 218

Advertising
background image

Backplane API Functions

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 218 of 342

ProSoft Technology, Inc.

February 20, 2013

MVIbp_SendMessage

Syntax

int MVIbp_SendMessage(MVIHANDLE handle, WORD *buffer, WORD length, WORD
reserved, WORD timeout);

Parameters

handle

Handle returned by previous call to MVIbp_Open

buffer

Pointer to buffer of data to send to processor

length

The length in words of the message to send.

reserved

Must be set to 0

timeout

Maximum number of milliseconds to wait for processor to read message

Description
This function sends a message to the control processor.

handle must be a valid handle returned from MVIbp_Open.

Upon calling this function, length should contain the message size in words.
buffer must point to a buffer of at least length words in size.

If length exceeds the maximum message size specified by the value
MsgSndBufSize (refer to the MVIbp_SetIOConfig function),
MVI_ERR_BADPARAM will be returned.

reserved is not used for the MVI94 module and must be set to zero.
MVI_ERR_BADPARAM will be returned if reserved is not zero.

timeout specifies the number of milliseconds that the function will wait for the
message to transfer to the control processor. If the timeout occurs before the
message has been transferred, MVI_ERR_TIMEOUT will be returned.

If timeout is 0, the function will return immediately. If the message was
successfully queued to be sent, MVI_SUCCESS will be returned. If the message
was not queued (for example, a previous message is being sent),
MVI_ERR_TIMEOUT will be returned and the message must be re-tried at a later
time. A timeout of 0 allows an application to perform other tasks while the
message is being transmitted.

Before this function can be used, messaging must be enabled with the
MVIbp_SetIOConfig function. If messaging has not been enabled,
MVI_ERR_BADCONFIG will be returned.

MVI46 Notes The MVI46 passed Message data to the Controller via the M1 module file. This

requires the MVI46 to be configured as a Class 4 module.

The MVIbp_SendMessage function copies the message data into a buffer to be retrieved by the
processor via a MSG instruction. The MSG instruction must be configured as shown in table B. The

MSG instruction implements a "get attribute" command to the MVI-ADM module’s assembly object.

The MSG instruction will fail if a message has not already been written by the application via

MVIbp_SendMessage.

MVI69 Note: At this time, messaging is not supported on the MVI69.

Advertising