+
+
+
+
+
+
+
+
43052
A B
B
24 Rockwell Automation Publication 1756-PM012E-EN-P - November 2012
Chapter 3 Send a Message to Multiple Controllers
You need to complete the following to send a message to multiple controllers:
Set Up the I/O Configuration
Define Your Source and Destination Elements
Create the MESSAGE_ CONFIGURATION Data Type
Create the Configuration Array
Get the Size of the Local Array
Load the Message Properties for a Controller
Configure the Message
Step to the Next Controller
Restart the Sequence
Set Up the I/O Configuration
Although not required, we recommend that you add the communication
modules and remote controllers to the I/O configuration of the controller. This
makes it easier to define the path to each remote controller.
For example, once you add the local communication module, the remote
communication module, and the destination controller, clicking Browse lets you
select the destination.
TIP To copy the above components from a sample project, open the samples folder.
For version 20 and earlier of the application:
\RSLogix 5000\Projects\Samples
For version 21 and later:
\Users\Public\Documents\Studio 5000\Samples\ENU\[version]\Rockwell Automation
Open this project.
Message Path Browser
Path: peer_controller
peer_controller
I/O Configuration
[0] 1756-CNB/x Local_CNB
2 [0] 1756-CNB/x chassis_b
[1] 1756-L55/x peer_controller
+
+
Message Properties
message
message.Path.
message.RemoteElement.
+
+
Configuration Array
message_config
message_config[0]
message_config[0].Path
message_config[0].RemoteElement
message_config[1]
message_config[1].Path
message_config[1].RemoteElement
+
+
+
+
First Message Execution
Next Message Execution
Message Properties
message
message.Path.
message.RemoteElement.
+
+
Tag Name Type Scope
message_config MESSAGE_CONFIGURATION[number]
(1)
(1) Number indicates the number of controllers to send the message
Any
Rockwell Automation Publication 1756-PM012E-EN-P - November 2012 27
Send a Message to Multiple Controllers Chapter 3
2. Into the message_config array, enter the path to the first controller that
receives the message.
A. Type the path to the remote controller.
OR
B. Click the Browse button and browse to the remote controller.
3. Into the message_config array, enter the tag name or address of the data in
the first controller to receive the message.
Tag Name Value
message_config {}
message_config[0] {} Right-click and select Go To > Configure.
message_config[0].Path
message_config[0].RemoteElement
+
+
A
B
For example:
Tag Name Value
message_config {}
message_config[0] {}
message_config[0].Path
message_config[0].RemoteElement
message_config[1] {}
message_config[1].Path
message_config[1].RemoteElement
+
+ ...
Type the tag name or address of the data in the other
controller.
+
+
28 Rockwell Automation Publication 1756-PM012E-EN-P - November 2012
Chapter 3 Send a Message to Multiple Controllers
4. Enter the path and remote element for each additional controller.
Get the Size of the Local Array
The SIZE instruction:
counts the number of elements in local_array.
counts the number of elements in Dimension 0 of the array. In this case,
that is the only dimension.
Local_array_length (DINT) stores the size (number of elements) of local_array.
This value tells a subsequent rung when the message has been sent to all the
controllers and to start with the first controller again.
Tag Name Value
message_config {}
message_config[0] {}
message_config[0].Path
message_config[0].RemoteElement
message_config[1] {}
message_config[1].Path
message_config[1].RemoteElement
+
+
+
+
43051
Rockwell Automation Publication 1756-PM012E-EN-P - November 2012 29
Send a Message to Multiple Controllers Chapter 3
Load the Message Properties for
a Controller
1. The XIO instruction conditions the rung to continuously send the
message.
2. The first COP instruction loads the path for the message. The value of
index determines which element the instruction loads from
message_config. The instruction loads one element from message_config.
3. The second COP instruction loads the tag name or address of the data in
the controller that receives the message. The value of index determines
which element the instruction loads from message_config. The instruction
loads one element from message_config.
Configure the Message
Although the logic controls the remote element and path for the message, there is
initial configuration.
43051
2.
3.
1.
30 Rockwell Automation Publication 1756-PM012E-EN-P - November 2012
Chapter 3 Send a Message to Multiple Controllers
IMPORTANT
Table 1 - Message Configuration
On this tab If you want to For this item Type or select
Configuration Read (receive) data from the other
controllers
Message Type The read-type that corresponds to the other controllers
Source Element Tag or address that contains the data in the first controller
Number Of Elements 1
Destination Element local_array[*]
Index 0
Write (send) data to the other
controllers
Message Type The write-type that corresponds to other controllers
Source Element local_array[*]
Index 0
Number Of Elements 1
Destination Element Tag or address that contains the data in the first controller
Communication Path Path to the first controller
Cache Connections Clear the Cache Connections checkbox. Since this procedure continuously
changes the path of the message, it is more efficient to clear this checkbox.
43054
Clear the Cache Connections checkbox.
Rockwell Automation Publication 1756-PM012E-EN-P - November 2012 31
Send a Message to Multiple Controllers Chapter 3
Step to the Next Controller
After the MSG instruction sends the message:
1. the first ADD instruction increments index. This lets the logic load the
configuration properties for the next controller into the MSG instruction.
2. the second ADD instruction increments the LocalIndex member of the
MSG instruction. This lets the logic load the value from the next
controller into the next element of local_array.
Restart the Sequence
When index equals local_array_length, the controller has sent the message to all
the other controllers.
1. The first CLR instruction sets index equal to 0. This lets the logic load the
configuration properties for the first controller into the MSG instruction
and start the sequence of messages again.
2. The second CLR instruction sets the LocalIndex member of the MSG
instruction equal to 0. This lets the logic load the value from the first
controller into the first element of local_array.
1. 2.
43051
1. 2.
43051
32 Rockwell Automation Publication 1756-PM012E-EN-P - November 2012
Chapter 3 Send a Message to Multiple Controllers
Notes:
Rockwell Automation Publication 1756-PM012E-EN-P - November 2012 33
Index
A
array
controller configuration 26
B
block transfer
guidelines 13
buffer
for unconnected message 12, 13
C
cache
connection 11
communicate
message instruction 9
other controllers 9
connection
cache 11
controller
message properties 29
messages 9
D
data type
convert data 16
message configuration 25
G
guidelines
message 13
L
ladder logic
manage messages 19
M
message
cache connection 11
controller 9
convert between 16 and 32-bit data 16
example illustration 10
guidelines 13
limits 10
manage multiple messages 19
processing 10
queue 10
to a single controller 9
to multiple controllers 23
unconnected buffer 12, 13
P
processing
message 10
Q
queue
message 10
T
tag
guidelines for messages 13
organize for message 9
34 Rockwell Automation Publication 1756-PM012E-EN-P - November 2012
Index
Rockwell Otomasyon Ticaret A.., Kar Plaza Merkezi E Blok Kat:6 34752 erenky, stanbul, Tel: +90 (216) 5698400
Publication 1756-PM012E-EN-P - November 2012 36
Supersedes Publication 1756-PM012D-EN-P - November 2011 Copyright 2012 Rockwell Automation, Inc. All rights reserved. Printed in the U.S.A.
Rockwell Automation Support
Rockwell Automation provides technical information on the Web to assist you in using its products.
At http://www.rockwellautomation.com/support/, you can find technical manuals, a knowledge base of FAQs, technical and
application notes, sample code and links to software service packs, and a MySupport feature that you can customize to make the
best use of these tools.
For an additional level of technical phone support for installation, configuration, and troubleshooting, we offer TechConnect
support programs. For more information, contact your local distributor or Rockwell Automation representative,
or visit http://www.rockwellautomation.com/support/.
Installation Assistance
If you experience a problem within the first 24 hours of installation, review the information that is contained in this manual.
You can contact Customer Support for initial help in getting your product up and running.
New Product Satisfaction Return
Rockwell Automation tests all of its products to ensure that they are fully operational when shipped from the manufacturing facility.
However, if your product is not functioning and needs to be returned, follow these procedures.
Documentation Feedback
Your comments will help us serve your documentation needs better. If you have any suggestions on how to improve this document,
complete this form, publication RA-DU002, available at http://www.rockwellautomation.com/literature/.
United States or Canada 1.440.646.3434
Outside United States or Canada Use the Worldwide Locator at http://www.rockwellautomation.com/support/americas/phone_en.html, or contact your local Rockwell
Automation representative.
United States Contact your distributor. You must provide a Customer Support case number (call the phone number above to obtain one) to your
distributor to complete the return process.
Outside United States Please contact your local Rockwell Automation representative for the return procedure.