1. Preparation before communication
First, create a new project and name it "Communication between s7-1200", as shown below:
Then configure the device and select the CPU 1214C DC/DC/RLY of s7-1200, version number 4.1, as shown below:
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:
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:
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:
In the device view, switch to the topology view, add the switch and PC respectively, and connect them as shown in the following figure.
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:
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.
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:
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:
Then add a global data block named send, as shown below:
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:
Select send[DB5], right-click and select Properties, and uncheck the checkbox. As shown below:
The following are the settings for the instruction "TSEND_C":
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:
Similarly, right-click receive[DB6] and select properties, and uncheck the checkboxes. As shown below:
The settings for the instruction "TRCV_C" are as follows:
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:
The settings of the TRCV_C instruction in PLC_2 are configured as follows:
The instructions TSEND_C and TRCV_C are set as follows:
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
Download the PLC_2 program to the PLC
Add monitoring tables in PLC_1 and PLC_2, as shown below:
Start two PLCs and monitor them, enter the name and click Modify. The test results are as follows:
At this point, the communication is successful.
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
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications