How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Introduction:

In actual work environments, PLCs may communicate and exchange data. Typically, communication requires devices to be on the same network segment. However, what if our devices are not on the same segment? This article introduces how two PLCs can perform TCP/IP communication to exchange data when they are not on the same network segment.

01

Open the TIA Portal project, create the “PLC_1” device, add CPU1215, and set the IP address, subnet mask, and system clock as shown in Figures 1 and 2.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 1

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 2

02

Create the “PLC_2” device, add CPU1215, and set the IP address, subnet mask, and system clock as shown in Figures 3 and 4.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 3

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 4

03

In “PLC_1”, add DB3 and DB4 data blocks (as shown in Figures 5 and 6) for storing and sending data. Both sending and receiving data are 100 bytes in length. Note: The data types for sending and receiving are arrays and are non-optimized access blocks.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 5

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 6

04

In “PLC_1”, program in the OB1 main program block.

① Add the “TCON” instruction and click the configuration icon, as shown in Figures 7 and 8.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 7

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 8

② Add the sending and receiving data instructions, as shown in Figure 9.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 9

05

In “PLC_2”, add DB3 and DB4 data blocks (as shown in Figures 10 and 11) for storing and sending data. Both sending and receiving data are 100 bytes in length. Note: The data types for sending and receiving are arrays and are non-optimized access blocks.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 10

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 11

06

In “PLC_2”, program in the OB1 main program block.

① Add the “TCON” instruction and click the configuration icon, as shown in Figures 12 and 13.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 12

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 13

② Add the sending and receiving data instructions, as shown in Figure 14.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 14

07

Simulation testing, as shown in Figure 15.

How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Figure 15

Source: Jicheng Training Network, Author: Guo Biao, unauthorized reproduction is prohibited~


Exclusive for fans
【Complete Siemens Materials】


How to Achieve TCP/IP Communication Between Different PLC Networks in 7 Steps

Previous Recommendations

Siemens S7-1200 PLC Water Tank Level Control Program Case

5 Project Cases for Quick Entry into C# Host Development~

Confused about switching, analog, and pulse quantities? The most comprehensive programming algorithms for PLCs explained, understand thoroughly after reading!

One trick to quickly replace the drawing frame made in Solidworks

How to control the EtherCAT bus with Inovance Servo? Only experts know!

40 images to help you understand power supply system diagrams, all done in 5 minutes!

How to download TIA Portal WinCC Advanced projects?

64 Essential Siemens E-books for Learning Automation | Free to Receive

Three common shortcut methods to exit sketches in Solidworks, which one do you prefer?

Leave a Comment