Loading
Send data between Controllers with Handshake Sequence | CMX | Studio 5000

Send Data between Controllers with Handshake in Studio 5000

The Data Buffer and Handshake sequence is defined for applications that require sending and receiving data with a validation bit for sending and receiving the same. - [Deploy Time: 30 Minutes]
An electrical panel displaying multiple wires and switches, emphasizing the integration of a PLC for efficient operations.
On This Page:
  • What is this for?
  • Implementation Guide
Innovation Center Home
 

What is this for?

Sometimes there is a need to send data from one controller to another and be confident the data being sent/ received is accurate and not a combination of old and new data. This application note shows how to send one (500byte) packet of buffered data using a Produce / Consume (Class 1) connection over Ethernet/IP.

 

General Features

  • Data Buffer
  • Handshake

 

Advantages: This sequence facilitates the implementation and quick configuration when is need it to send one packet of buffered data using a Produce / Consume (Class 1) connection over Ethernet/IP, without any other hardware.

Limitations/Disadvantages: This sequence is available for CompactLogix / ControlLogix Controllers.

Downloads

Please note: You will need to agree to the Terms & Conditions for each download.

Download files ›
Legal Disclaimer Acceptance. ROCKWELL AUTOMATION WILL PROVIDE ACCESS TO ROCKWELL PRODUCTS (BEST PRACTICES, APPLICATIONS AND KNOWLEDGE) ON THE CONDITION THAT YOU ACCEPT AND COMPLY WITH THE FOLLOWING TERMS AND CONDITIONS. YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT BY DOWNLOADING, INSTALLING, COPYING, OR OTHERWISE USING PRODUCTS. IF YOU ARE ACCEPTING THESE TERMS ON BEHALF OF ANOTHER PERSON, COMPANY, OR OTHER LEGAL ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL AUTHORITY TO BIND THAT PERSON, COMPANY, OR LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT AGREE TO THESE TERMS, DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, OR USE THE PRODUCTS, SOFTWARE AND/OR CLOUD SERVICES. 1. Rockwell Automation retains full ownership and title to all Products and related documentation. No rights or licenses are granted other than those set forth in this Agreement. Company grants to Rockwell Automation a non-exclusive, worldwide, royalty-free, perpetual, non-revocable license to use any feedback Company provides regarding the Products, even if Company has designated the feedback as confidential. Rockwell Automation will be entitled to use the feedback without restriction or compensation to Company. 2. Company may not lease sub-lease, assign, license, sub-license or otherwise transfer any of the Products without the prior written consent of Rockwell Automation. Company may not assign or otherwise transfer access rights to the Products without the prior written consent of Rockwell Automation. Any reverse assembly, reverse engineering, decompilation, and creation of derivative works based on the Products by Company is prohibited. 3. Company acknowledges that Products provided under this Agreement are Rockwell Automation’s Confidential Information and are covered by effective or pending copyrights, patents, trademarks and/or trade secrets of Rockwell Automation, and Company agrees to maintain confidentiality by not disclosing Products or documentation to any third party without the prior written consent of Rockwell Automation and to protect the confidentiality of the Products as it would Company’s own confidential information. Company agrees that its obligation of confidentiality under this paragraph shall survive expiration or termination of this Agreement. 4. Company agrees that Products provided under this Agreement are prototypes and examples and its application and results may vary depending on each customer and project conditions. Rockwell Automation do not warranty the same results. This Agreement shall in no way be construed as a commitment by Rockwell Automation at any time to manufacture and/or offer Products for sale. There is no explicit or implicit service level agreement associated with using the Products. Rockwell Automation does not warrant that the functions contained in the Products will meet Company’s requirements. Company agrees to use all Products only in accordance with the instructions and only for the intended usages identified in the documentation. 5. EXCLUSION OF WARRANTIES AND LIMITATION OF LIABILITY. THE PRODUCTS ARE PROVIDED "AS IS". ROCKWELL AUTOMATION DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ROCKWELL AUTOMATION EXPLICITLY DISCLAIMS ALL WARRANTIES OF NON- INFRINGEMENT AND EXPRESSLY DOES NOT WARRANT THAT THE PRODUCTS, IN WHOLE OR IN PART, WILL BE ERROR FREE OR FREE FROM SECURITY VULNERABILITIES. IN NO EVENT SHALL ROCKWELL AUTOMATION BE LIABLE FOR (i) LOST PROFITS, LOST SAVINGS, DOWNTIME, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR (ii) ANY PERSONAL INJURY, PROPERTY DAMAGE OR ENVIRONMENTAL DAMAGE ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT, WHETHER IN AN ACTION IN CONTRACT, STRICT LIABILITY OR IN TORT INCLUDING NEGLIGENCE. 6. COMPANY AGREES TO INDEMNIFY AND HOLD ROCKWELL AUTOMATION HARMLESS FROM ALL COSTS, AWARDS, DAMAGES, EXPENSES AND FEES (INCLUDING ATTORNEYS FEES) RESULTING FROM OR RELATED TO ANY THIRD-PARTY CLAIMS (INCLUDING EMPLOYEES AND AGENTS OF COMPANY) AGAINST ROCKWELL AUTOMATION, ITS DISTRIBUTORS, AGENTS, OFFICERS, DIRECTORS OR EMPLOYEES FOR PERSONAL INJURY (INCLUDING DEATH), PROPERTY DAMAGE OR ENVIRONMENTAL DAMAGE RELATED TO OR RESULTING FROM THE USE OF THE PRODUCTS. 7. In the event a Product is exported, Company agrees to comply with all applicable United States Export Control Law and Regulations, and the applicable export control laws of other countries. This Agreement shall be governed by the laws of the state of Wisconsin. This Agreement is the complete and exclusive Agreement between Rockwell Automation and the Company, and supersedes all prior agreements, whether written or oral, relating to the Products.

Need Help?

If you need help with an application or have feedback from the Innovation Center, please contact us.

Is this helpful?
This code is defined for applications when it is needed to send one packet of buffered data over Ethernet/IP.


Application areas: Food, Manufacturing, Beverage

 

How can I get this working?

  • Hardware
    • Personal computer with an available USB port
    • CompactLogix, ControlLogix Controller 
  • Software
    • Studio 5000, version 21 or later
  • Previous knowledge:
    • Intermediate knowledge of programming and configuration in Studio 5000 software: Ladder language (LD)
 
 
 

Implementation Guide 

 
 
  • Step 01

     

    Next steps offer an explication on the code and how buffer of data before sending it to another controller and using handshaking numbers (#’s) to indicate when a new packet of data has arrived.

     
     

    Buffering of data: One reason for buffering data would be to keep a running list of data before transferring in case there is a communication failure. Another reason would be to make sure the data packet you are creating is complete. In this example I am buffering 10 (492byte) packets in a first in / first out fashion. If this is too much data buffering, this can be customized to your application.

     

    Handshaking is used to indicate when there is a new packet of data being sent/ received. Some applications use what is called a footer # at the end of the packet, other applications use a header # at the beginning of the packet. In this example, I am using both a header and footer #. The basic operation of this is as follows; every time a new packet of data is ready to be sent, the incremented header and footer #’s are attached to the beginning and end of the (492byte) packet of data, making it a full (500byte) produce/ consume packet, when the other controller sees there is a difference between the old header/ footer # and the new header/ footer # it knows this is a new packet of data and buffers it in its memory. This new header / footer # is stored to be checked later when a new packet is sent again. This is taken one step further by introducing a bidirectional handshaking method. This means I am sending either the header or footer # back to the producer of the data as a trigger to send another packet.

    send-data-between-controllers-with-handshake-in-studio-5000_Step 1-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step 1-Image1

     
     

    There are two Control Logix programs, one program produces data, and the other program consumes data. The program that is producing data is called CLX1_producing_ data_with_handshaking_ and_Buffering1. The program that consumes data is called CLX2_consuming_data_with_handshaking. They will be referenced as program CLX1_Produce and CLX2_Consume.

     

    Data must be collected and buffered before sending it to the produced tag.

     

    Refer to CLX1_produced program Rungs 7, 8, and 9.

     

    Rung 7. Data is collected and buffered in a First in First out manner. In this example I am buffering 10 (123dint) data chunks (1 – 10). If there is no data in the 10th buffered data chunk, add 123 to the Buffered data pointer, if there is data there, stop filling the Buffered register.

     

    Rung 8. When data appears in the 10th (123dint data chunk buffered register, The buffered register area is full and will set the Buffer full output.

     

    Rung 9. If Buffer full output is set, shift Buffered data chunks 2 – 10 up by (123dints). Then fill the 10th buffered data chunk with zeros.

     
  • Step 02

     

    Now that we have data buffered, start producing this data on the Ethernet network. Refer to CLX1_produced program Rungs 10, 11. 

     

    Rung 10. Will copy the first chunk of data from the Buffer to the produced tag.

     

    Rung 11. Will assign a Header and Footer ID #. These numbers will range from (0 – 100). These ID’s will also be used as the handshaking numbers between the two CLX processors. The next scan through the ID’s will be increased by 1.

     

    At this point the packet is formed and looks like this:

     

    • Producing_data_to_CLX1
      • [0] = Header ID#
      • [1] - [123] = Data
      • [124] = Footer ID#
    send-data-between-controllers-with-handshake-in-studio-5000_Step2-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step2-Image1

  • Step 03

     
     

    The data is being consumed by another CLX2 processor over Ethernet. The consumed tag looks like this:

     
    • Consumed_data_from_CLX1
      • [0] = Header ID#
      • [1] - [123] = Data
      • [124] = Footer ID#

     

    Refer to CLX2_consumed program Rung 1.

     

    Rung 1. Compares the New ID’s assigned in Step 2 Rung 11 to the old ID’s Buffered in Step 6 Rung6. If the ID’s are different, it knows it is reading a new packet of data.

    send-data-between-controllers-with-handshake-in-studio-5000_Step3-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step3-Image1

  • Step 04

     
     

    If the communications stop, the control needs to be aware of this, refer to CLX2_consumed program Rung 2, 3, and 4.

     

    Rung2. Every time there is a different in ID’s seen the counter counts +1

     

    Rung3. If the counter doesn’t get done within 5 sec. the retentive timer times out.

     

    Rung4. If the retentive timer gets done, there have not been comms for over 5 sec and the no comms. between clx1 and clx2 output is set. This can be used as an alarm bit.

     
    send-data-between-controllers-with-handshake-in-studio-5000_Step4-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step4-Image1

  • Step 05

     
     

    Double checking that the Header and Footer ID’s did not change. Refer to CLX2_consumed program Rung 5.

     
    send-data-between-controllers-with-handshake-in-studio-5000_Step5-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step5-Image1

  • Step 06

     
     

    Now it's time to copy data from the consume tag to a different register in the CLX2, to be used in its program.

     

    Next move the present header and footer ID #’s into the Old ID register to be compared later when the next packet of new data is sent over. Now for the handshaking portion of the program.

     

    The Footer ID # is sent back to the CLX1, in a Produced tag, to act as the handshaking piece of data, which will be compared in the CLX1 as you will see in Step8. Refer to CLX2_consumed program Rung 6 to 8.

     
    send-data-between-controllers-with-handshake-in-studio-5000_Step6-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step6-Image1

  • Step 07

     
     

    Once again if communications stop, the control needs to be aware of this. Refer to CLX1_produced program Rung 2, 3, and 4.

     

    Rung2. Every time there is a different in ID’s seen the counter counts +1

     

    Rung3. If the counter doesn’t get done within 5 sec. the retentive timer times out.

     

    Rung4. If the retentive timer gets done, there have not been comms for over 5 sec and the no comms. between clx1 and clx2 output is set. This can be used as an alarm bit.

     
    send-data-between-controllers-with-handshake-in-studio-5000_Step7-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step7-Image1

  • Step 08

     
     

    Referring to Step6, the footer ID # is being produced by CLX2 and will now be consumed by CLX1, if the initial produced ID # matches the now consumed ID #, there is still communications, the handshaking is complete, and CLX1 is now ready produce a new packet of data.

     

    But before producing a new packet of data, we must examine if our ID # has reached 100, if so, reset back to 0, and start counting up to 100 again. Refer to CLX1_produced program Rung 5 and 6.

     
    send-data-between-controllers-with-handshake-in-studio-5000_Step8-Image1.jpg

    send-data-between-controllers-with-handshake-in-studio-5000_Step8-Image1

 
send-data-between-controllers-with-handshake-in-studio-5000_Step 1-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step 1-Image1

send-data-between-controllers-with-handshake-in-studio-5000_Step2-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step2-Image1

send-data-between-controllers-with-handshake-in-studio-5000_Step3-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step3-Image1

send-data-between-controllers-with-handshake-in-studio-5000_Step4-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step3-Image1

send-data-between-controllers-with-handshake-in-studio-5000_Step5-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step5-Image1

send-data-between-controllers-with-handshake-in-studio-5000_Step6-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step6-Image1

send-data-between-controllers-with-handshake-in-studio-5000_Step7-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step7-Image1

send-data-between-controllers-with-handshake-in-studio-5000_Step8-Image1.jpg

send-data-between-controllers-with-handshake-in-studio-5000_Step8-Image1

 
 
 
 
 

Send Data between Controllers with Handshake in Studio 5000

Version 1.0 - November 2024

Subscribe!

Receive new app releases and other news from the Innovation Center directly to your inbox.

I want to subscribe
  1. Chevron LeftChevron Left Rockwell Automation Home Chevron RightChevron Right
  2. Chevron LeftChevron Left Sup... Chevron RightChevron Right
  3. Chevron LeftChevron Left Pro... Chevron RightChevron Right
  4. Chevron LeftChevron Left Downloads Chevron RightChevron Right
  5. Chevron LeftChevron Left Innovation Center Chevron RightChevron Right
  6. Chevron LeftChevron Left Send Data between Controllers with Handshake in Studio 5000 Chevron RightChevron Right
Please update your cookie preferences to continue.
This feature requires cookies to enhance your experience. Please update your preferences to allow for these cookies:
  • Social Media Cookies
  • Functional Cookies
  • Performance Cookies
  • Marketing Cookies
  • All Cookies
You can update your preferences at any time. For more information please see our {0} Privacy Policy
CloseClose