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 | 1308 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 Krauss Maffei PC301-K 01-310-301-K Industrial PC
  • SIGMATEK SDD310-23 VARAN Servo Drive
  • SIGMATEK CDM 163 and CIC 011 C-DIAS Input Modules
  • SIGMATEK MDP 101-1 Power Module
  • SIGMATEK CM5V020 Wiring Circuit with CTMS020
  • SIGMATEK CCP521 C-DIAS Processor Module
  • SIGMATEK MDP 101-K Power Module
  • SIGMATEK ETEK C-IPC 733MHz VIA Eden 7000
  • SIGMATEK DCP 643 DIAS PLC CPU Module
  • SIGMATEK TAE121 12-200-121 Operator Terminal
  • Sigmatek TMS012-T Injection Moulding Technology Module
  • Sigmatek MDD 121-1 Controller
  • Sigmatek CDM167 Module
  • Sigmatek DCP082 DIAS Central Unit
  • Sigmatek ETT731 Built-In Terminal Touch
  • Sigmatek CCP521 C-DIAS Processor Module
  • Sigmatek Krauss Maffei PC301-K Control Cabinet PC
  • Sigmatek CIC-21 C-DIAS CAN Module
  • Sigmatek CIO-011 Multi I O Module
  • Sigmatek 01-450-152D C-IPC 152 Industrial PC
  • SIGMATEK 01-450-024 C-IPC 128MB VIA 733MHz
  • SIGMATEK CCL-081 C-DIAS Processor Module
  • SIGMATEK CP311 20-004-311 Module
  • SIGMATEK EP00000262 SLIDES MIDI I O-V3 Controller
  • SIGMATEK TMS012-T Slides Technology Module
  • SIGMATEK MDD111-1 Drive Axis Module
  • SIGMATEK MDP101-1 PLC Module
  • SIGMATEK CP111 S-DIAS Processor Module
  • DEMAG ErgoControl Sigmatek NC4 Display Unit
  • SIGMATEK DCP642 Module
  • Sigmatek Demag NC4 9617.067.03 Control Module
  • Sigmatek DCP 643 Central Processing Unit
  • Sigmatek VI 021 S-SLIDES VARAN Interface Module
  • Sigmatek SDD340-46 Servo Drive 14kVA
  • Sigmatek DSI021 Slide Siemens Interface
  • Sigmatek CCL912 C-SLIDES CPU PSU Module
  • Sigmatek ETV1521 VARAN Control Panel
  • Sigmatek ET322 Operator LCD Terminal
  • Sigmatek MDD1111 DIAS Drive Module
  • Sigmatek CAM123 Module
  • SIGMATEK CP111 VARAN Ethernet Controller
  • SigmaTek MDD 111 Axle Module
  • SIGMATEK CIO013 C-DIAS I O Module
  • SIGMATEK AKM52K-ANC2GBB0 Servomotor 640VDC
  • SIGMATEK ETT321 01-230-321 Touch Screen
  • SIGMATEK NC4Kompakt 01-250-010-D Safety Controller
  • SIGMATEK CIO011 C-DIAS Multi I O Module
  • SIGMATEK MDD 121-1 Drive Axis Module
  • SIGMATEK CDM163 Control Module
  • Sigma-Tek 4000HR-3 Heading Reference Directional Gyro
  • Sigmatek DIAS DAI 883 Analog Input Module
  • Sigmatek 0332.554.03 Printed Circuit Board Card
  • Sigma Tek 5000B-36 Attitude Gyro 8130
  • Demag NC4 0332.554.03 Sigmatek Control Board
  • Sigmatek IPC Pentium 300 CF Industrial PC
  • Sigmatek MDP 102 PLC Module
  • Sigmatek DTO163 Digital Output Module
  • Sigmatek PCT151 Touch IPC 15 Panel and I-PC C300
  • Sigmatek CCL911 CD Processor Module
  • Sigmatek SCP011 S-DIAS Safety CPU Module
  • Sigmatek SE051 Network Splitter Module
  • Sigmatek CIO011 C-DIAS I O Module
  • Sigmatek SE051 Ethernet Splitter
  • Sigmatek CCL911 CD Processor Module
  • Sigmatek SDD310-4 DIAS Drive 14kVA
  • Sigmatek CTMS020 C-DIAS Technology Module
  • Sigmatek CTMS020 CD Technology Module
  • Sigmatek CTO167 C-SLIDES Digital Output Module
  • Sigmatek C-IPC 152 Industrial PC
  • Sigmatek SDD310-4 SLIDES Drive 310
  • SIGMATEK MDP 102-1 DIAS Power Module
  • SIGMATEK SCP111 S-DIAS Safety CPU Industrial
  • SIGMATEK CAO081 Analog Output Module
  • SIGMATEK DCC080L Control Module
  • SIGMATEK MDP101-1 Power Module
  • SIGMATEK SCP111 S-DIAS Safety CPU
  • SIGMATEK PC325-K Industrial PC
  • SIGMATEK ETT 731 Operator Terminal
  • SIGMATEK DSV011 SLIDES Hub Module 05-023-011
  • SIGMATEK 12-780-012 R8-IPC Industrial Computer
  • Sigmatek SE051 Ethernet Splitter
  • Sigmatek DAI 883 DIAS Analog Module
  • Sigma Tek 4000B-30 Directional Gyro
  • Sigmatek CP112 S-DIAS Processor Module
  • Sigmatek SDD310 DIAS Drive
  • Sigmatek SDD120-23 DIAS Drive 14kVA
  • Sigmatek C-IPC 152 Industrial PC
  • Sigmatek CIV513 VARAN Control Module
  • Sigmatek DCP 082 Processor Module
  • Sigmatek C-IPC Industrial PC 01-450-023 GEB
  • SIGMATEK PC572 Operating Terminal
  • SIGMATEK DCC041 DIAS Compact Controller HW 6.10
  • SIGMATEK C-IPC 152 1GB Celeron M440 Controller
  • SIGMATEK 01-310-322-K PC322-K Industrial PC
  • SIGMATEK TAE732-P Touch Screen Operator Panel
  • SIGMATEK 01-018-100 Control Module
  • SIGMATEK DDI-164 Digital Input Module
  • Sigma-Tek 5000B-36 Artificial Horizon
  • SIGMATEK 12-780-012 R8-IPC Geode LX800 Computer
  • SIGMATEK CTMS 020 Servo Drive
  • Sigmatek MDD121-1 Controller
  • Sigmatek ETV1021-L VARAN Terminal
  • Sigmatek DST022 DIAS Module
  • Sigmatek CCP512-K C-Dias Processor Module
  • Sigmatek SRO 021 Relay Output Module
  • Sigmatek SDI 101 Digital Input Module
  • Sigmatek IPC 221 Industrial PC
  • Sigmatek DNC-305 Digital Input Module
  • Sigmatek SDD335 DIAS Drive
  • Sigmatek C-IPC Industrial Controller
  • SIGMATEK 01-450-031 C-IPC 256MB LX800 Computer
  • SIGMATEK SDD310-3 DIAS Drive 310
  • SIGMATEK DSV011 SLIDES Hub Module 05-023-011
  • SIGMATEK CNC031 CD Analog Module 12-011-031
  • SIGMATEK 01-450-031 C-IPC 256MB LX800
  • SIGMATEK 01-450-026 C-IPC VIA 733MHz Controller
  • SIGMATEK DCP-643 DIAS CPU Module with DKL-003
  • SIGMATEK MDD111-L DIAS Drive Axis Module
  • SIGMATEK SDD310-23-L DIAS Drive 310
  • SIGMATEK Viscotec ETV0551 Touch Panel
  • SIGMATEK PC321K Industrial Computer
  • SIGMATEK MDP 102-1 SLIDES Power Module
  • SIGMATEK TAE-151 12-200-151 Light Terminal
  • SIGMATEK CP102 20-004-102P6995B HMI Panel
  • SIGMATEK CAM-123 12-017-123-C Analog Mixing Module
  • SIGMATEK DCC041 DIAS Compact Controller
  • SIGMATEK DVI021 and DKL015 DIAS Power Module
  • SIGMATEK SDD340-46 SDD Series Servo Drive