In modern industrial production, it is often the case that the host computer needs to communicate with the third-party slave computer, such as third-party instruments, inverters, temperature modules, pressure transmitters, etc. In this case, ModbusRTU and ModbusTCP/IP protocols are required. If your third-party device supports the ModbusTCP/IP protocol, network communication can be used.
Today we will introduce the TCP communication of Siemens 1200 and 1500 using the TIA Portal platform. After reading this case, you can draw inferences from it and apply it to actual projects. This case is for reference only.
We need to meet the following software and hardware requirements when doing this project case:
1.) A Siemens 1200 series PLC (in this case, it is 1215DCDCDC. The controller does not have to be the same as the one in this case, as long as it supports the modbusTCP protocol);
2.) A Siemens 1500 series PLC (in this case, it is 1513, the controller does not have to be the same as this case, as long as it supports the modbusTCP protocol);
3.) A computer with TIA Portal V16 software installed;
4.) Two communication network cables and one DC24V/10A switching power supply.
After the above conditions are met, we open the TIA Portal and start configuration. Here we first configure a server (1513PLC) and create a server communication data DB block:
How to build:
Add a data block named "TCON_IP_V4" in "Program Block". There is no need to cancel "Access Optimization Block". Add communication data with the data name "TCON" and data type "TCON_IP_V4" in the static variable "Static".
Open the "TCON" data to set the parameters, set "Interfaceld" (communication hardware port) to "64", set ID to "8", set "Connection Type" (communication protocol) to 16#0B, the default is TCP communication protocol, "ActiveEstblished" (establish connection), "1" is active connection (client), "0" is passive connection (server), continue to open "RemoteAddress" and find the "ADDR" array to set the communication IP address (generally not set by default as a server), and finally set the "LocalPort" server port number to "502".
We call the TCP communication instruction block "MB_SERVER" and drag it to the program terminal to set parameters:
After writing the server program, we configure a client PLC (i.e. 1215PLC). After configuration, we also need to add a communication data DB block, which is slightly different from the server parameters, as shown in the following figure:
The data block parameters of client and server "TCON_IP_V4" differ in the following parameters:
1.) Active Established (Established connection), "1" for active connection (client), "0" for passive connection (server). This is a client, so fill in "1"
2.) Open "RemoteAddress" and find the "ADDR" array to set the communication IP address (here is the client, you need to fill in the server IP address, that is, Siemens 1513PLC);
3.} Remote Addrese here needs to fill in the server port number (502);
4.) LocalPort" server port number is "0".
After the communication parameters are set, add a TCP communication instruction "MB——CLAYend" as shown below:
Writing data from the client to the server
We add a program to read the server:
Read server data from client (server writes data to client)
Read requirements:
The five data of MW20-MW28 on the server side (Siemens 1513) are stored in MW50-MW58 on the client side (Siemens 1215). It can also be said that the server writes to the client side.
The controller online monitoring is as follows:
Condition Monitoring:
1200/1500 data transfer
The above is a brief introduction to the data transmission between 1200 and 1500 PLCs through the Modbus TCP communication protocol. I hope it can provide a reference and help for friends who want to learn Siemens PLC communication. There are inevitably some imperfections or even errors in the article. I hope the experts will criticize and correct me.
Previous article:The principle, advantages and disadvantages of belt conveyor belt anti-deviation device
Next article:Three steps to teach you how to play S7-1500OPC communication configuration and OPC communication
Recommended ReadingLatest update time:2024-11-16 09:39
- 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
- Please tell me, what is the problem of no response for a long time during burning?
- Recruiting embedded software development engineers, embedded BSP engineers
- Basic Theory of System Timing
- Application of RFID and other Internet of Things technologies in smart ranches
- EEWORLD University Hall ---- Engineering Test Technology Foundation Huazhong University of Science and Technology
- Looking for national standards? Here is the national standards website, which will definitely be useful to you!
- How to achieve automated testing of LCR?
- How to speed up the program running speed of Huada HC32F460 HC32F4A0?
- FPDLINK Spark Interference Optimization
- Why do electrolytic capacitors explode? Find out in one article!