Backplane api messaging functions – ProSoft Technology MVI69-ADM User Manual

Page 216

Advertising
background image

Backplane API Functions

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 216 of 342

ProSoft Technology, Inc.

February 20, 2013

8.5

Backplane API Messaging Functions

MVIbp_ReceiveMessage

Syntax

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

Parameters

handle

Handle returned by previous call to MVIbp_Open

buffer

Pointer to buffer to receive message data from processor

length

Pointer to a variable containing the maximum message length in words.
When this function is called, this should be set to the size of the indicated
buffer. Upon successful return, this variable will contain the actual
received message length.

reserved

Must be set to 0

timeout

Maximum number of milliseconds to wait for message

Description
This function retrieves a message sent from the control processor.

handle must be a valid handle returned from MVIbp_Open.

Upon calling this function, length should contain the maximum message size in
words to be received.

buffer must point to a buffer of at least length words in size. Upon successful
return, length will contain the actual length of the message received.

If length exceeds the maximum message size specified by the value
MsgRcvBufSize (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 a
message. To poll for a message without waiting, set timeout to zero. If no
message has been received, MVI_ERR_TIMEOUT will be returned.

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.

If the message received from the control processor is larger than length, the
message will be truncated to length words and MVI_ERR_MSGTOOBIG will be
returned.

MVI46 Notes: The Controller passes Message data to the MVI46 via the module’s M0 module file.

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

Advertising