Welcome to the Industrial Automation website!

NameDescriptionContent
XING-Automation
E-mail  
Password  
  
Forgot password?
  Register
当前位置:

Based on the S7-300/400 Ethernet module CP343-1 &CP443-1 Modbus TCP used in STEP7 Door (V6.0)

F: | Au:佚名 | DA:2023-11-21 | 1328 Br: | 🔊 点击朗读正文 ❚❚ | Share:

1 Overview of Modbus TCP communication

MODBUS TCP is a simple, vendor-neutral derivative of the MODBUS family of communication protocols for managing and controlling automation devices, and it obviously covers the purpose of MODBUS messages in the "Intranet" and "Internet" environments that use TCP/IP. The most common use of the protocol is for services such as PLCS and gateways connecting to other simple domain buses or I/O modules.

MODBUS TCP enables MODBUS_RTU to run on Ethernet. MODBUS TCP uses TCP/IP and Ethernet to transmit MODBUS packets between sites. MODBUS TCP combines Ethernet physical networking with the networking standard TCP/IP and data representation with MODBUS as the application protocol standard. MODBUS TCP communication packets are encapsulated in Ethernet TCP/IP packets. Unlike the traditional serial port mode, MODBUS TCP inserts a standard MODBUS message into the TCP message without the data checksum address.

1.1 Ethernet reference model for communication

The Modbus TCP transmission process uses Layer 5 of the TCP/IP Ethernet reference model:

Layer 1: The physical layer provides the physical interface of the device and is compatible with the commercially available media/network adapter.

The second layer: the data link layer, formats the signal to the source/destination hardware address data frame.

Layer 3: The network layer implements packets with 32-bit IP addresses.

The fourth layer: the transport layer, to achieve reliable connection, transmission, error checking, retransmission, port service, transmission scheduling.

Layer 5: Application layer, Modbus protocol packets.

1.2 Modbus TCP Data frame

Modbus data is transmitted over TCP/IP Ethernet and supports Ethernet II and 802.3 frame formats. The Modbus TCP data frame consists of three parts: packet header, function code and data. The Modbus Application Protocol (MBAP) packet header is divided into four domains. Total 7 bytes.

1.3 Port Number for Modbus TCP

(1) When PLC is used as Modbus server, Port 502 communication port is used according to default protocol, and any communication port is set in the Modus client program.

(2) When PLC is used as Modbus client, it is not necessary to set the local port number; If you want to specify a client port number, you are advised to start with 2000 to avoid conflicts with other communication protocols.

2 Overview of Modbus TCP communication on the S7-300/400 Ethernet module

This document applies to SIMATIC S7-300, S7-400 CPU with Ethernet module CP343-1 or CP443-1 software products. The instructions allow communication between S7-300, S7-400 systems with Ethernet modules CP343-1 or CP443-1 and devices that support the Modbus TCP protocol.

Data transmission is carried out according to the client-server principle. SIMATIC S7 can be used as a client or server during transfer.

2.1 Software and Hardware

When Modbus TCP commands are used in STEP7 software, the Modbus TCP CP instruction library needs to be installed before SIMATIC S7-300, S7-400 CPU with Ethernet module CP343-1 or CP443-1 can communicate with the communication partners that support Modbus TCP. As shown in Figure 2-1:

2.2 Modbus TCP CP V6.0 Software Option Package

When the software package is installed and integrated into Step7, you can find the block library, routines, and English manual in the corresponding directory of the Step7 installation file, as shown in the following figure. In the actual debugging process of the project, since the functions of the example program are relatively perfect, you can directly use the example program and modify the corresponding parameters according to the actual situation of the project. Can save a lot of parameter setting time.

3 Configure the Ethernet module as the Modbus TCP Server to communicate with the communication partner

The following uses the S7-300 single-site system and Modscan32 software as an example to describe how to configure the S7-300 single-site system as the Modbus TCP Server through the Ethernet module CP343-1 to communicate with Modscan32 as a Client.

3.1 Configuring Hardware

Create a new project (project name: MB_TCP_CP_V60) in STEP7.

3.2 Adding a TCP Connection

On the Hardware Configuration page, click "Configure Network" under Options to enter the network configuration page.

Next, select CPU, and in the table below, right-click and select "Insert New Connection" to add the TCP connection.

The communication partner is Unspecified and the connection type is TCP connection.

Select the local connection resource number (default ID=1) and PLC as the server. Note that "Active connection establishment" is not checked.

Click the "Addresses" page and set the local port number to 502.

3.3 Routine Description

Open the routine and copy all program Blocks (do not copy System data) from site SIMATIC 300 (Server) to the blocks of site SIMATIC 300 (1) of new project MB_TCP_CP_V60.

(1) Open OB1 and view the command "MODBUSCP"

The Modbus TCP command is invoked in the OB1 organizational block of the project,

The following are some pin descriptions (for other pin information, please see the instruction library manual) :

  • SIGMATEK SDD310-2 Servo Drive
  • SIGMATEK AI084 Analog Input Module
  • SIGMATEK CRCH081 12-752-081 Temperature Module
  • Sigma-Tek 5000L-4 Attitude Gyro 1U284-001-3
  • SIGMATEK CM5V020 12-250-023-K Wiring Module
  • Sigma-Tek 4000H-6 Directional Gyro IU262-035-7
  • SIGMATEK Dias DCP160 05-004-160 Processor Module
  • SIGMATEK 0147.395.02 Control Module
  • SIGMATEK A1084 Control Module
  • SIGMATEK DI200 20-006-2000 Digital Input Module
  • Sigmatek DNC115 Encoder Module
  • Sigmatek DAM122 05-017-122 Analog Module
  • Sigmatek 9802.289.01 Control Board TA71 Display
  • Sigmatek TO127 20-007-127 Digital Output Module
  • Sigmatek DNC031 05-011-031 Digital Module
  • Sigmatek VI022 20-003-022 Interface Module
  • Sigmatek CAI085 Analog Input Module
  • Sigmatek CP111 S-DIAS CPU Module
  • Sigmatek CTMS030 Krauss Maffei Module
  • Sigmatek CAM123 Control Module
  • Sigmatek TAE732-P 01-240-732-P Touch Display Unit
  • Sigmatek MDM021 Digital Mixed Module
  • Sigmatek DCP642 DIAS Central Unit
  • Sigmatek CST022 12-014-022 C-DIAS Module
  • Sigmatek SRO021 20-893-021 Safety Relay Output
  • Krauss Maffei MC5 Control System Sigmatek
  • Sigmatek DC061 Module 18-24VDC 300mA
  • Herrmann EVT0855 Ultrasonic Welder Touch Panel
  • Sigmatek CIV521 Control Module 1.4A 2W
  • Sigmatek DDI61 05-006-161 Digital Input Module
  • SIGMATEK ETT312-E Touch Terminal 01-230-312
  • Cessna S3326-1 Sigma Tek 5000B-67 Gyro 1U149-015-9
  • SIGMATEK PS101 Power Supply Module
  • SIGMATEK 0332.554.03 Control Module 371071000154
  • SIGMATEK ETT312-E Touch Terminal 01-230-312
  • SIGMATEK CDM163 Control Module
  • SIGMATEK VSV046 16-023-046 Module
  • SIGMATEK AM221 20-017-221 Analog Module
  • SIGMATEK CTS051 12-053-051 Control Module
  • SIGMATEK AM221 20-017-221 Analog Module
  • Sigmatek CSDI161 12-891-161 Safety Input Module
  • Sigma Tek 4000C-1 Directional Gyro Indicator
  • Sigmatek ETV0501 12-230-0501 VARAN Terminal
  • Sigmatek DDM165 SLIDES Module
  • Sigmatek N100 20-011-100 Control Module
  • Sigmatek AKM54K-ANC2R-B0 PM Servo Motor
  • Sigmatek CTO166 Digital Output Module
  • Sigmatek CP212-K 20-004-212-K CPU Module
  • Sigmatek CDI161 Digital Input Module
  • Sigmatek DCC080 05-700-080-2 Control Module
  • SIGMATEK SCP011 S-DIAS Safety CPU
  • SIGMATEK SCP011 S-DIAS Safety CPU
  • SIGMATEK SRO022 Relay Output Module
  • SIGMATEK MDD 121 Drive Axis Module
  • SIGMATEK DSI021 SLIDES Siemens Interface
  • SIGMATEK DIAS DCP161 Module 05-004-161
  • Sigmatek ETT312 Built-in Touch Terminal
  • SIGMATEK DCP 643 DIAS Controller System
  • SIGMATEK CIO021 Multi I/O Module
  • SIGMATEK CTMS020 Control Module
  • Sigmatek CME 221 Memory Module
  • Sigmatek 0420.615.01 Control Board
  • Sigmatek CP111 20-004-111 CPU Module
  • Sigmatek 9405.065.03 Control Board
  • Sigmatek ETEK 01-450-032-K C-IPC 256MB Industrial PC
  • Sigmatek CTO163 12-007-163 Safety Output Module
  • Sigmatek TO081 20-007-081 Digital Output Module
  • Sigmatek SI021 20-022-021 Safety Input Module
  • Sigmatek 05-052-014 Control Module HW 1.0
  • Sigmatek TO127 20-007-127 Digital Output Module
  • Sigmatek SV141 20-023-141 VARAN Splitter
  • SIGMATEK CIV513 C-DIAS VARAN Control Module
  • Sigmatek DCP 642 SLIDES Control Module with DKL002
  • Sigma-Tek 5000B-36 Attitude Gyro
  • SIGMATEK 01-450-024 C-IPC Industrial Computer
  • SIGMATEK CP102 S-DIAS Processor Module
  • Sigmatek CRCH081 12-752-081 PLC Module
  • SIGMATEK SDD340-46 Series Drive
  • SIGMATEK TAE731 Touch Display Unit
  • SIGMATEK CDM167 Module 12-008-167-O
  • SIGMATEK TO161 Digital Output Module
  • Sigmatek NC4 45291000003 Control Board
  • Sigmatek HGW1033-3 Handheld Wireless Unit
  • Sigmatek CAI0811 Analog Input Module
  • Sigmatek STO081 S-DIAS Safety Output Module
  • Sigmatek C-IPC 01-450-171-V Industrial PC
  • Sigmatek S1 032-8AF61-R4 EZ Servo Motor
  • Sigmatek CM5V020 Baseplate 12-250-021-K
  • Sigmatek HGT833-W Panel
  • Sigmatek NC4 45291000003 Control Module
  • SIGMATEK 12-780-012 R8-IPC Geode LX800
  • SIGMATEK CCP081 Processor Module
  • SIGMATEK SCP011 S-DIAS Safety CPU
  • SIGMATEK ETT1533 Touchscreen 01-230-1533
  • SIGMATEK AI043 Analog Input Module
  • SIGMATEK CTMS020 Control Module
  • SIGMATEK SLIDES VARAN Interface VAC 012
  • SIGMATEK Compact Control Unit 06038666
  • SIGMATEK CP112 Control Module
  • SIGMATEK MDP 101-1 Power Supply Module
  • Sigmatek CCP621 C-SLIDES Processor Module
  • Sigmatek MDD111 Axle Module
  • Sigmatek CCL912 C-SLIDES CPU PSU Module
  • Demag NC4 0332.554.03 Sigmatek Control Board
  • Sigmatek Krauss Maffei PC321-K Control Cabinet PC
  • Sigmatek CNC W150 Circuit Board Wittmann Robot
  • Sigmatek AKM44G-ANCNGBB0 Servo Motor
  • Sigmatek CSCP011 Safety Module 12-890-011
  • Mannesmann Demag Sigmatek CP126 Central Unit
  • Sigmatek ISE021 Interface Module 20-101-021
  • Sigmatek CCP251 C-DIAS Processor Module
  • SIGMATEK ET 352 Terminal
  • SIGMATEK SV141 Module 20-023-141
  • SIGMATEK NC-337 3 Axis Module
  • Sigmatek MDP 101 Power Module
  • SIGMATEK HGT834-W Teach Pendant
  • Sigmatek C-DIAS Processor Module CCL912
  • SIGMATEK CP627 Module
  • SIGMATEK PC 323-K Controller
  • SIGMATEK MDD121 Controller Module
  • SIGMATEK ICA111 Module
  • SIGMATEK MDD 121-1 Drive Axis Module
  • SIGMATEK M5V121 12-300-121 Krauss Maffei M5 Display Unit
  • SIGMATEK CTMS 020 CD Technology Module 12-250-011
  • SIGMATEK PCT122 Touch Panel
  • Stöger MCS4100 SIGMATEK Control Module
  • SIGMATEK Krauss Maffei M5 Keyboard Unit M5K902 12-310-902
  • SIGMATEK SD310-2 Servo Drive Module