Ethernet Communication Technology of Siemens S7-1200

Publisher:jingwenLatest update time:2024-05-07 Source: elecfansKeywords:Siemens Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Preparation before communication

First, create a new project and name it "Communication between s7-1200", as shown below:

edc8f866-4d43-11ee-a25d-92fbcf53809c.png

Then configure the device and select the CPU 1214C DC/DC/RLY of s7-1200, version number 4.1, as shown below:

ede60f0a-4d43-11ee-a25d-92fbcf53809c.jpg

After opening the project, select the PLC_1 device view, select the "Properties" option below, then select "System and Clock Memory", and check the checkbox on the right that displays the Enable Clock Memory Byte, as shown below:

edf9df4e-4d43-11ee-a25d-92fbcf53809c.jpg

Then select the Ethernet port in the PLC_1 device and set the IP address of PLC_1 to 192.168.0.1 in the Ethernet address, as shown in the figure below:

ee1f94aa-4d43-11ee-a25d-92fbcf53809c.jpg

Then copy and paste PLC_1 into PLC_2. Similarly, set the IP address of PLC_2 to 192.168.0.2 on the Ethernet port. The previous system and clock memory have been set up, so PLC_2 does not need to be set up again. The details are as follows:

ee3a8d00-4d43-11ee-a25d-92fbcf53809c.jpg

In the device view, switch to the topology view, add the switch and PC respectively, and connect them as shown in the following figure.

ee57b786-4d43-11ee-a25d-92fbcf53809c.jpg

At this point, the device settings before communication have been completed.

2. Programming

In the PLC_1 project, select the program block to open main (OB1), select "Open User Communication" in the communication item on the right, select the "TSEND_C" instruction and drag and drop it into main (OB1) to generate the background data block DB1, named: TSEND_C_DB. As shown in the figure below:

ee8231e6-4d43-11ee-a25d-92fbcf53809c.jpg

Select the command and the following configuration screen will pop up. Set it as shown below. Select TCP in the connection type. In the connection data row, select New in the drop-down menu to generate the screen shown below.

eea1b868-4d43-11ee-a25d-92fbcf53809c.jpg

In the PLC_1 project, select the program block to open main (OB1), select "Open User Communication" in the communication item on the right, select the "TRCV_C" instruction and drag and drop it into main (OB1) to generate the background data block DB2, named: TRCV_C_DB, as shown below:

eee366a0-4d43-11ee-a25d-92fbcf53809c.jpg

Select the command and the following configuration screen will pop up. Set it as shown below. Select TCP in the connection type. In the connection data line, select New in the drop-down menu to generate the following screen:

ef026668-4d43-11ee-a25d-92fbcf53809c.jpg

Then add a global data block named send, as shown below:

ef20cc48-4d43-11ee-a25d-92fbcf53809c.jpg

In the opened global data block name column, name it send, select array in the data type and set it to array[0....99]of string, as shown below:

ef470e44-4d43-11ee-a25d-92fbcf53809c.jpg

Select send[DB5], right-click and select Properties, and uncheck the checkbox. As shown below:

ef6ec768-4d43-11ee-a25d-92fbcf53809c.jpg

The following are the settings for the instruction "TSEND_C":

ef8ba4a0-4d43-11ee-a25d-92fbcf53809c.jpg

Add a global data block and name it "receive", then open it and name it "receive", select array as the data type and set it to array[0....99]of string, as shown below:

ef9ddbc0-4d43-11ee-a25d-92fbcf53809c.jpg

Similarly, right-click receive[DB6] and select properties, and uncheck the checkboxes. As shown below:

efc05d62-4d43-11ee-a25d-92fbcf53809c.jpg

The settings for the instruction "TRCV_C" are as follows:

efdcf5e4-4d43-11ee-a25d-92fbcf53809c.jpg

At this point, the programming configuration of PLC_1 has been completed. The programming configuration settings of PLC_2 are similar to those of PLC_1. The basic settings are shown below:

The settings of the TSEND_C instruction in PLC_2 are configured as follows:

eff75844-4d43-11ee-a25d-92fbcf53809c.jpg

The settings of the TRCV_C instruction in PLC_2 are configured as follows:

f02a0a78-4d43-11ee-a25d-92fbcf53809c.jpg

The instructions TSEND_C and TRCV_C are set as follows:

f04bc884-4d43-11ee-a25d-92fbcf53809c.png

f06d5210-4d43-11ee-a25d-92fbcf53809c.png

At this point, the programming configuration of PLC_1 and PLC_2 has been completed.

Download Test

Download the program of PLC_1 to PLC

f0865d32-4d43-11ee-a25d-92fbcf53809c.jpg

f0a317d8-4d43-11ee-a25d-92fbcf53809c.jpg

Download the PLC_2 program to the PLC

f0c5d4d0-4d43-11ee-a25d-92fbcf53809c.jpg

f0eea860-4d43-11ee-a25d-92fbcf53809c.jpg

Add monitoring tables in PLC_1 and PLC_2, as shown below:

f1083564-4d43-11ee-a25d-92fbcf53809c.jpg

f1167a98-4d43-11ee-a25d-92fbcf53809c.jpg

Start two PLCs and monitor them, enter the name and click Modify. The test results are as follows:

f12c61e6-4d43-11ee-a25d-92fbcf53809c.jpg

At this point, the communication is successful.


Keywords:Siemens Reference address:Ethernet Communication Technology of Siemens S7-1200

Previous article:Principle of pilot piston structure pneumatic solenoid valve
Next article:PLC Automation Solutions - Advantages and Selection of ABB Programmable Logic Controllers

Recommended ReadingLatest update time:2024-11-16 09:17

Public variables and local variables of Siemens PLC
① Variable V (only for S7-200): In S7-200, the internal variable of PLC is marked with the English letter V. Its function is similar to that of internal registers, which can be used to store the intermediate operation results of PLC program, but the number of variables that can be used is greater. The content of int
[Embedded]
Talk about the communication knowledge of Siemens S7-1500 PLC
Siemens S7-1500PLC is used in medium and large projects. It is an upgraded version of S7-300/400PLC. Compared with 200/200 SMART PLC, 1500 is a little more difficult. Communication is a more important part and it involves advanced applications. Today we will talk about the communication knowledge of 1500PLC.
[Embedded]
Talk about the communication knowledge of Siemens S7-1500 PLC
Solution to the defect of Siemens PR2 type disconnector not closing properly
introduction As the main equipment of substation, disconnectors play an indispensable role in ensuring the reliable operation of substations. When disconnectors cannot open and close normally or the opening and closing is not in place, it will seriously affect the safety and stability of the power grid, especia
[Embedded]
Solution to the defect of Siemens PR2 type disconnector not closing properly
Siemens touch screen and S7-1200/1500PLC time synchronization function
Functional description: To have the same time of day for the entire plant, you can use time synchronization to synchronize the times of the plant components. One system component must act as a clock so that all components of the plant run at the same time. The component that acts as a clock is called the time m
[Embedded]
Siemens touch screen and S7-1200/1500PLC time synchronization function
Using UBIQUITY router to realize remote control of PLC - Taking Siemens S7-1200 as an example
With the development of various industrial protocols, each factory will face the challenge of implementing multiple different protocols and equipment interconnection, including traditional machinery and equipment. In order to adapt to the development of the Internet of Things, significantly improve efficiency, reduc
[Embedded]
Using UBIQUITY router to realize remote control of PLC - Taking Siemens S7-1200 as an example
Siemens launches new generation Sinumerik 828 CNC system software and hardware product portfolio
Siemens launched the new generation Sinumerik 828 CNC system software and hardware product portfolio at the 16th China International Machine Tool Show (CIMT2019), further promoting the digitalization of the standard CNC market. The upgraded Sinumerik 828 software and hardware product portfolio uses comprehensive data
[Embedded]
Siemens launches new generation Sinumerik 828 CNC system software and hardware product portfolio
Parameter setting and use of Siemens MM440 inverter
1. Siemens inverters have a full range of specifications. The power ranges from a few hundred watts to thousands of kilowatts; the functions range from low-end to high-end; the rated voltage ranges from low voltage, medium voltage to high voltage; and they are divided into AC inverters and DC inverters. This chapter
[Embedded]
Parameter setting and use of Siemens MM440 inverter
FIA selects Siemens as official supplier of sustainable PLM software
• Siemens Xcelerator helps the International Automobile Federation (FIA) and its championships improve the environmental sustainability of motorsports    Siemens Digital Industries Software recently announced that the International Automobile Federation (FIA), the world's governing body for motorsport and the fed
[Industrial Control]
FIA selects Siemens as official supplier of sustainable PLM software
Latest Embedded Articles
Change More Related Popular Components
Guess you like

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号