Rockwell Automation Allen-Bradley ControlLogix 1756-MVI Programming Reference Manual page 37

Multi-vendor interface module
Hide thumbs Also See for Allen-Bradley ControlLogix 1756-MVI:
Table of Contents

Advertisement

MVIbp_ReceiveMessage
The MVIbp_ReceiveMessage function retrieves data written to the MVI
module by the processor via a MSG instruction. The MSG instruction
must be configured as shown in table 3.E. The MSG instruction
implements a 'put attribute' command to the MVI module's assembly
object. The MSG instruction will fail if a message has already been
written to the MVI module but the application has not yet retrieved the
message via MVIbp_ReceiveMessage.
Table 3.E - Receive MSG Instruction Configuration
Field
Value
Message Type
CIP Generic
Service Code
10 (Hex)
Object Type
4
Object ID
8
Object Attribute
3
Num Elements
application dependent
Path
application dependent
Return Value:
MVI_SUCCESS
MVI_ERR_NOACCESS
MVI_ERR_TIMEOUT
MVI_ERR_BADPARAM
MVI_ERR_BADCONFIG
MVI_ERR_MSGTOOBIG
Example:
MVIHANDLE
Handle;
int
rc;
WORD
buffer[250];
WORD
length;
length = 250;
// maximum message size that can be received
// Wait up to 5 seconds for a message
rc = MVIbp_ReceiveMessage(Handle, buffer, &length, 0, 5000);
if (rc = = MVI_SUCCESS)
printf("Message received. Length is %d words\n", length);
See Also:
MVIbp_GetIOConfig
MVIbp_SendMessage
Description
Specify CIP message type
Set_Attribute_Single service
Assembly object class code
Output message instance number
Data attribute
Size of message to be written
Path to MVI module
a message has been received
handle does not have access.
timeout occurred before message received
a parameter is invalid
receive messaging is not enabled
the received message is too big for the buffer
Publication 1756-RM004B-EN-P - October 2000
MVI Backplane API
3-15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents