By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
Inst ToolsInst ToolsInst Tools
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: Moving Data between PLCs – Siemens Basics – TSEND TRCV
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Ask
  • Courses
  • Videos
  • Q & A
  • EE
  • Measure
  • Control
  • More
Search
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Moving Data between PLCs – Siemens Basics – TSEND TRCV

Moving Data between PLCs – Siemens Basics – TSEND TRCV

Learn how to do moving data between PLCs in this Siemens basics tutorial article based on the TSEND and TRCV function blocks.

Last updated: January 4, 2024 4:46 pm
Mahmoud Salama
PLC Tutorials
No Comments
Share
11 Min Read
SHARE

In the previous article, we talked about how to set up a connection between two PLCs using open user communication, and we used the TCP protocol to connect between two PLCs. We showed in the article how to use instructions like TCON and TDISCON to establish this connection.

Contents
Moving Data between PLCsSend Data to PLC_2Receive Data from PLC_1Simple logic to automatically create data valuesSimulation of the PLC project

Moving Data between PLCs

In this article, we will show how we can start moving DATA between the PLCs we connected last article. We will use the TSEND and TRCV blocks for this purpose.

Send Data to PLC_2

We will build on the project we created in the last article, which means there are already the TCON and TDISCON blocks installed into our project. and we will continue our project by adding the TSEND and TRCV blocks to start moving data between the two PLCs.

To send data from PLC_1 into PLC_2 let’s start by creating a data block that will hold all information we need to send to PLC_2. See picture 1.

Moving Data between PLCs

picture 1. Create a new data block.

As we discussed before, it is a better practice to give a proper naming to your blocks, that way it will be easy and intuitive to figure out what is each block are meant for.

Second, let’s add some data inside the Data block which we want to send to PLC_2.

We assumed that we need to send three different data tags. See picture 2.

TSEND TRCV in PLC Projects

picture 2. Define some data to send to PLC_2.

There is one more thing we need to do to be able to send the data block we just created to PLC_2 and that is to make sure the optimized block access of the Data block is not selected.

To do that we need to go to properties of the data block and unselect that option. See pictures 3 and 4.

Siemens Automation Communication

picture 3. Go to properties of data block.

PLC Data Sharing Protocols

picture 4. Uncheck the Optimized block access option.

Make sure to uncheck this option before using the TSEND block, or it won’t work.

Now that we prepared the data we want to send to the PLC_2 let’s actually attempt to send it. We will do that by using the TSEND block. Just drag and drop the instruction into your main OB1 to add it to your logic. See picture 5.

PLC Data Transmission Techniques

picture 5. Add TSEND block.

When adding the TSEND block you will be asked to create an instance data block because it is essentially a function block, again give it a proper name. See picture 6.

Cross-PLC Data Communication

Picture 6. Create data instance for the TSEND.

When the TSEND block is added into your logic, you will find that there are some important configurations we need to make. See picture 7.

PLC Data Transfer Basics

picture 7. The TSEND block.

As you can see, we need to make some configuration:

  • The REQ signal to allow the sending of the data.

As for the REQ signal, we will define a tag SendData that will be used to enable the sending of the data. 

  • ID of the connection I will use to send the data, because I can have more than one connection, so I need to assign which connection will be used.

In the last article, we defined the ID 1 for the connection between PLC_1 and PLC_2, so we will set the ID to 1.

  • DATA that I need to send. We already created a data block with all information I need to send, we can simply just drag and drop the data block into the TSEND block. See picture 8.
TSEND and TRCV function blocks

picture 8. Configure the TSEND block.

Receive Data from PLC_1

After we setup the TSEND for sending the data to PLC_2, we need to receive these data inside the PLC_2. To do that we will use the TRCV block. See picture 9.

Tcon, Tdiscon, Tsend, And Trcv

picture 9. Add TRCV block.

As you can see, just drag and drop the TRCV block to add it into your logic. And you know that next we will need to create a data instance to that block. See picture 10.

Siemens TRCV

picture 10. Add data instance to TRCV block.

After the TRCV block is called into your logic, we will need to configure some parameters as we did with the TSEND. See picture 11.

Siemens TSEND

picture 11. The TRCV block.

As you can see, the EN-R is an enable signal that must be true to allow the TRCV block to start receiving the data. The ID is the connection that will be used and the DATA is where the received data will be stored.

So, we need to create a data block to receive the data inside it. Remember to give it a proper name. See picture 12.

Open user communication PROFINET

picture 12. Create data block to receive data.

Next, define the information tags that will be received from PLC_1, it is a best practice to ensure the data block hold the same data structure as the data that will be received. See picture 13.

SIEMENS S7 PLC to PLC Communication Example

picture 13. Define data tags.

For the EN-R, we will define a RecieveData tag to enable the data receive. And for the connection ID it is 1 as we set it up before. See picture 14.

Communication Between 2 PLCs

picture 14. EN-R signal.

Next, drag and drop the data block we created into our TRCV block to finish all configurations. See picture 15.

PLC to PLC Communication TIA Portal

picture 15. Add your data block into TRCV block.

When you drag and drop the DB we created, you will notice that TIA Portal is giving a warning and that it is not accepting the data block we just added.

And that is because we didn’t unchecked the “Optimized block access” of the data block as we did with TSEND. See picture 16.

Profinet to Siemens PLC

picture 16. Optimized block access.

As we said before, we have to uncheck this option otherwise the TSEND and TRCV won’t work. See picture 17.

Siemens S7 Data Transfer

picture 17. Uncheck the optimized block access option.

You can see that once we unchecked the “optimized block access” the data block is now accepted with the TRCV instruction.

Now that the calling and configuration of the TSEND and TRCV blocks is done. Let’s simulate our project and see how the data will be sent and received.

First we will create a simple logic that ensures that there are data values for our defined tags.

Simple logic to automatically create data values

We will create a simple logic to automatically create and update the data values so it will be easier to see the data transfer between the two PLCs. See picture 18.

Siemens Networking Basics

picture 18. Simple logic.

This simple logic will use the clock bit %M50.5 to automatically change the values of the data stored inside SendToPLC_2 data block. 

Simulation of the PLC project

Let’s compile our project and start a simulation. The first thing we will need to do is to establish the connection between the two PLCs using the TCON block we configured last article.

Remember that we will need to enable the connection capability from PLC_2 and establish the connection with PLC_1. See pictures 19, 20 and 21.

Efficient PLC Data Handling

picture 19. No connection between PLCs

PLC Data Logging and Transmission

picture 20. enable the connection.

Siemens PLC Peer-to-Peer Communication

picture 21. Establish the connection.

Now, that we established the connection between the two PLCs let’s move the data from PLC_1 into PLC_2 as we set it up.

First, make the SendData tag TRUE. See picture 22.

Siemens Communication Blocks

Picture 22. REQ signal is true.

You can see that, even though the SendData is TRUE, there were no data sent from PLC_1 to PLC_2. And that is because the TRCV block is not yet enabled to receive any data. See picture 23.

Real-Time Data Exchange in PLCs

picture23. EN-R signal is false.

As you can see, because the RecieveData is not yet TRUE, the TRCV block is not enabled to receive any data. Once the EN-R is true the data will be sent from the data block in PLC_1 into the data block of PLC_2. See picture 24.

Siemens PLC Data Handling

picture 24. EN-R signal is True.

Once the EN-R is true, you can see that the data is moved from PLC_1 into PLC_2.

If you open the project and simulate it yourself, you will find the data is continuously being updated in PLC_1 and transferred into PLC_2.

And this is how we can establish a communication between two PLCs and use TSEND, TRCV blocks.

In the next article, we will talk about another compact block that can do the same functionality as the TCON, TDISCON and TSEND using one block.

Download the project files.

  • PLC Logic Document
  • PLC Source Code

If you liked this article, then please subscribe to our YouTube Channel for Instrumentation, Electrical, PLC, and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • Free Schneider PLC Training
  • Real-time PLC Automation Projects
  • How to Choose a PLC for a Project?
  • How to Configure Distributed IO?
  • Zigbee Based Project Ideas and List
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !
What Factors Affect the Choice of PLC Programming Software?
#16 PLC Best Practices – Create Trend for Cycle Time on HMI
Tank Filling and Emptying using Intouch Scada Script
What is a Relay? Types of Industrial Relays
PLC Project Examples for EcoStruxure Machine Expert
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
208kSubscribersSubscribe
38kFollowersFollow

Recent Comments

  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals
  • Vaishnavi on Free Instrumentation Course for Trainee Engineers
  • anuj kapoor on DCS Program to Maintain Draft in Furnace
  • anuj kapoor on IoT based Smart Boiler Control System with Cloud PLC and SCADA

Related Articles

How to Download Rslogix Free

Download Allen Bradley RSLogix PLC Software

PLC program pushbutton switches

PLC Permissive for Motor Control

AENT Module in Rockwell PLC

AENT Module in Rockwell PLC – Remote IO Adapter

Ladder Logic Programming Examples

Ladder Logic Programming Examples

How to Get a PLC Programming Job With No Experience

How to Get a PLC Programming Job With NO Experience?

Rack Type PLC

PLC Input Output Modules

Field Instruments Questions and Answers

Control Room and Field Instruments Questions and Answers

One-Shot Rising and Falling Edge Instructions in Rockwell PLC

One-Shot Rising and Falling Edge Instructions in Rockwell PLC

More Articles

Smart Transmitter Calibration Tutorial Part 2

Smart Transmitter Calibration Tutorial Part 2

Zener Diode Voltage Regulator Operation

Zener Diode Voltage Regulator Operation

Reliability of a Control System

Reliability of a Control System

PLC Sizes and Applications

PLC Sizes and Applications

Difference Between Emergency STOP and Emergency Power OFF

Difference Between Emergency STOP and Emergency Power OFF

Discrete Manufacturing Automation

Discrete Manufacturing Automation

Basic Requirements of Sizing the Control Valves

Basic Requirements of Control Valves Sizing

Power Electronics Objective Questions

Thyristors Mock Test

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?