How to implement ModbusTCP communication between Siemens 1200PLC?

Publisher:数字之舞Latest update time:2023-07-30 Source: 自动化与工业机器人技术Author: Lemontree Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1200 exchanges data with other devices through communication. Siemens 1200PLC can communicate with Siemens series PLCs, such as S7-300/S7-1200/S7-1500, etc., using ModbusTCP, S7, Profinet and other communication protocols

Siemens 1200PLC supports the connection of 1 device (PG),

Siemens 1200PLC supports connection of 12 HMI devices

Siemens 1200PLC can communicate with third-party devices such as cameras, using ModbusTCP, Profinet and other communication protocols

When Siemens 1200PLC uses ModbusTCP communication, 1200PLC can be a client master or a server slave. When acting as a client, it actively requests a connection and sends commands. When acting as a server, it passively waits for a connection and feedbacks the status.

The client uses the MB_CLIENT directive and the server uses the MB_SERVER directive.

1200PLC ModbusTCP communication programming:

1. Open the TIA Portal software, create a new project, add two 1200PLCs, one as a client and one as a server, and add two touch screens

2. In the client PLC, create a function block and name it, then create two data blocks and command them. Uncheck the "Optimized block access" option in the data block properties, and define 8 variables of integer data type in each data block.

3. Find the ModbusTCP client communication instruction MB_CLENT in the instructions. Pay attention to the version of the communication instruction. The instruction usage of versions above V4.0 is different from that of version V3.1. For specific usage methods, please refer to the relevant help files.

4. Create two MB_CLIENT instructions with the same background data block and enter the variables associated with the pins.

MB_CLIENT instruction function description of each pin:

4. Configure 8 numeric input boxes on the touch screen, associate them with the variables in the "send" data in the PLC, and use them to input the data to be sent to the server. Configure 8 numeric display boxes, associate them with the variables in the "receive" data block in the PLC, and use them to display the data read from the server.

In the server PLC, create a function block and name it, then create a data block and command it, uncheck the "Optimized block access" option in the data block properties, and define 16 variables of integer data type in the data block.

Create the ModbusTCP server communication instruction MB_SERVER and enter the variables associated with the pins

MB_SERVER instruction function description of each pin:

The length of the server Modbus data must be greater than or equal to the total length of the client's sent and received data.

Configure 8 value input boxes on the touch screen, associate the S1-S8 variables in the "communication" data in the PLC, and use them to input the data to be sent to the client. Configure 8 value display boxes, associate the G1-G8 variables in the "communication" data block in the PLC, and use them to display the data received from the client.

PLC program and touch screen program

After completion, conduct a communication test.

Enter the sent data on the client touch screen and view the received data on the server touch screen

Enter the sent data on the server touch screen and check the received data on the client touch screen. If the data is correct, it means that the ModbusTCP communication between the two 1200PLCs is normal.






Review editor: Liu Qing

Reference address:How to implement ModbusTCP communication between Siemens 1200PLC?

Previous article:In the first half of 2023, 8 companies in the robotics industry chain are going public
Next article:Yifei Laser IPO rings the bell, and the revenue from automated production lines accounts for more than 60%

Latest robot Articles
Change More Related Popular Components

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号