Page 2
Flash will cause severe injury or death. Wear proper Personal Protective Equipment (PPE). Follow ALL Regulatory requirements for safe work practices and for Personal Protective Equipment (PPE). Allen-Bradley, Rockwell Software, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc. Trademarks not belonging to Rockwell Automation are property of their respective companies.
Page 3
Summary of changes This manual includes new and updated information. Use these reference tables to locate changed information. Grammatical and editorial style changes are not included in this summary. Global changes This table identifies changes that apply to all information about a subject in the manual and the reason for the change.
Preface This manual shows how to program message (MSG) instructions to and from Logix 5000™ controllers. This manual is one of a set of related manuals that show common procedures for programming and operating Logix 5000™ controllers. For a complete list of common procedures manuals, refer to the...
Preface These documents contain additional information concerning related Rockwell Additional resources Automation products. Resource Description Industrial Automation Wiring and Grounding Guidelines, Provides general guidelines for installing a Rockwell Automation industrial system. publication 1770-4.1 Product Certifications webpage, available at Provides declarations of conformity, certificates, and other http://ab.rockwellautomation.com certification details.
Page 10
Preface this document do not cover all the details or variations in the equipment, procedure, or process described, nor do they provide directions for meeting every possible contingency during installation, operation, or maintenance. This product’s implementation may vary among users. This document is current as of the time of release of the product;...
For more information, see "Convert between INTs and DINTs page 18". For complete details on programming a message instruction, see the LOGIX 5000 Controllers General Instruction Reference Manual, publication 1756-RM003. Example: Execute a message (MSG) instruction If count_send = 1 and count_msg.EN = 0 (MSG instruction is not enabled)
Chapter 1 Controller messages This diagram shows how the controller processes MSG instructions. Description The controller scans the MSG instruction and its rung-condition-in goes true. The message passes to a throttle that has 16 positions. If the throttle is full, the message remains enabled but is held until another controller scan.
Controller messages Chapter 1 Description The controller scans the MSG instruction. The rung-condition-in for the MSG instruction is true. The EN bit is set. The MSG instruction attempts to enter the queue but 16 throttle positions exist. If all 16 are filled and a 17th message is executed, the message is enabled. The EW bit remains cleared.
Page 14
Chapter 1 Controller messages The controller has the following limits on the number of connections that you can cache. If you have this software version and firmware Then you can cache revision • Block transfer messages for up to 16 connections. 11.x or earlier •...
If your message is to a device that uses 16-bit integers, such as a Logix 5000 controllers execute more efficiently and use less memory when working with 32-bit integers PLC-5 or SLC 500 controller, and it transfers integers (not REALs), (DINTs).
Chapter 1 Controller messages Keep the number of unconnected and uncached MSGs less than The controller can have 10 to 40 unconnected buffers. The default number is 10. the number of unconnected buffers. • If all unconnected buffers are in use when an instruction leaves the message queue, an error occurs, the data is not transferred.
Page 17
Source Length (bytes) 8 (Write 8 SINTs.) Destination Element destination_array where data type = SINT[6] (Leave all the values = 0.) Communication Path THIS or for earlier Logix 5000 controllers: 1, slot_number_of_controller Rockwell Automation Publication 1756-PM012H-EN-P - February 2018...
Source values for the MSG instruction, including the number of unconnected buffers that you want. In the Logix 5000 controller, use the DINT data type for integers whenever Convert between INTs and possible. Logix 5000 controllers execute more efficiently and use less memory DINTs when working with 32-bit integers (DINTs).
Page 19
Word 2 DINT_Array[2] INT_Buffer[2] Word 3 Description An FAL instruction converts the DINTs from the Logix 5000 controller to INTs. The MSG instruction writes the INTs from the temporary array to the device. Rockwell Automation Publication 1756-PM012H-EN-P - February 2018...
Page 20
Chapter 1 Controller messages Example: Read integer values from a PLC-5 controller If Condition_1 = 1 and Msg_1.EN = 0 (MSG instruction is not enabled) then read 3 integers from the PLC-5 controller and store them in INT_Buffer (3 INTs). If Msg_1.DN =1 (MSG instruction has read the data) then reset the FAL instruction.
Chapter 2 Manage multiple messages Introduction You can use ladder logic to send groups of message (MSG) instructions in sequence. • To be processed, each MSG instruction must enter the message queue. • The queue holds 48 MSGs. • If more than 16 MSGs are enabled at one time, the message throttle prevents some of the messages from entering the message queue.
Page 24
Chapter 2 Manage multiple messages Restart the sequence If the MSGs in group 2 (last group) are currently enabled (Msg_Group.2 = 1) and Msg_4 is in the state of done or error and Msg_5 is in the state of done or error then restart the sequence of MSGs with the first group: Msg_Group.2 = 0.
Page 25
Manage multiple messages Chapter 2 Send the second group of MSGs If Msg_Group.1 changes from 0 -> 1 then send Msg_2. send Msg_3. Enable the next group of MSGs If the MSGs in group 1 are currently enabled (Msg_Group.1 = 1) and Msg_2 is in the state of done or error and Msg_3 is in the state of done or error then:...
Page 26
Chapter 2 Manage multiple messages Send the next group of MSGs If Msg_Group.1 changes from 0 -> 1 then send Msg_2. send Msg_3. Rockwell Automation Publication 1756-PM012H-EN-P - February 2018...
Chapter 3 Send a message to multiple controllers Introduction Program a single message instruction to communicate with multiple controllers. To reconfigure a MSG instruction during runtime, write new values to the members of the MESSAGE data type. Important: In the MESSAGE data type, the RemoteElement member stores the tag name or address of the data in the controller that receives the message. If the message Then the RemoteElement is the Reads data...
Chapter 3 Send a message to multiple controllers • Load the Message Properties for a Controller page 33 • Configure the Message page 34 • Step to the Next Controller page 34 • Restart the Sequence page 35 Tip: To copy the above components from a sample project, open the C:\Users\Public\Public Documents\Studio 5000\Samples\ENU\v<current_project>\Rockwell Automation folder.
Send a message to multiple controllers Chapter 3 An array stores the data that is read from or written to each remote controller. Define your source and Each element in the array corresponds to another remote controller. destination elements 1. Use the following worksheet to organize the tag names in the local and remote controllers.
Chapter 3 Send a message to multiple controllers Create a user-defined data type to store the configuration variables for the message Create the MESSAGE_ to each controller. CONFIGURATION data type • Some of the required members of the data type use a string data type. •...
Send a message to multiple controllers Chapter 3 Store the configuration properties for each controller in an array. Before each Create the configuration execution of the MSG instruction, your logic loads new properties into the array instruction. This sends the message to another controller. 1.
Chapter 3 Send a message to multiple controllers 3. In the message_config array, enter the tag name or address of the data in the first controller to receive the message. 4. Enter the path and remote element for each additional controller. Tag Name Value message_config...
Send a message to multiple controllers Chapter 3 1. The XIO instruction conditions the rung to continuously send the message. Load the message properties for a controller 2. The first COP instruction loads the path for the message. The value of index determines which element the instruction loads from message_config.
Chapter 3 Send a message to multiple controllers The following table explains how to configure the message. Configure the message On this tab If you want to For this item Type or select Configuration Read (receive) data from the other Message Type The read-type that corresponds to the other controllers controllers...
Send a message to multiple controllers Chapter 3 When the index equals the local_array_length, the controller sends the message to Restart the sequence all other controllers. 1. The first CLR instruction sets the 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.
Page 37
Index convert between 16 and 32-bit data 18 example illustration 11 limits 12 array manage multiple messages 21 controller configuration 28 processing 11 queue 12 to a single controller 11 to multiple controllers 25 block transfer unconnected buffer 14, 16 guidelines 15 buffer for unconnected messages 14, 16...
Page 38
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 and application notes, sample code, and links to software service packs. You can also visit our Support Center at https://rockwellautomation.custhelp.com for software updates, support chats and forums, technical information, FAQs, and to sign up for product notification updates.