Publication 1756-RM004B-EN-P - October 2000
MVI Backplane API 3-17
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 3.F. The MSG
instruction implements a “get attribute” command to the MVI module’s
assembly object. The MSG instruction will fail if a message has not
already been written by the application via MVIbp_SendMessage.
Return Value:
MVI_SUCCESS a message has been received
MVI_ERR_NOACCESS
handle
does not have access
MVI_ERR_TIMEOUT timeout occurred before the message was
transferred
MVI_ERR_BADPARAM a parameter is invalid
MVI_ERR_BADCONFIG send messaging is not enabled
Example:
MVIHANDLE Handle;
int rc;
WORD buffer[250];
// Wait 5 seconds for the message to be sent
rc = MVIbp_SendMessage(Handle, buffer, 250, 5000);
if (rc = = MVI_SUCCESS)
printf(“Message sent\n”);
See Also:
MVIbp_GetIOConfig
MVIbp_ReceiveMessage
MVIbp_SendMessage
Table 3.F - Send MSG Instruction Configuration
Field Value Description
Message Type CIP Generic Specify CIP message type
Service Code OE (Hex) Get_Attribute_Single service
Object Type 4 Assembly object class code
Object ID 7 Output message instance number
Object Attribute 3 Data attribute
Num Elements application dependent Size of message to be written
Path application dependent Path to MVI module