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 | 1325 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 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
  • SIGMATEK CM5V020 CD Wiring Circuit Module
  • SIGMATEK ENGEL Robot Drive M3 02220-8748
  • Sigmatek CFF011 Drive Module
  • Sigmatek DCP642 DIAS Central Unit
  • Sigmatek SDM081 S-DIAS Safety Module
  • Sigmatek C-IPC 01-450-024 Industrial PC
  • Sigmatek Kompakt NC4 Control Module
  • Sigmatek VI021 VARAN Interface Module
  • Sigmatek Engel RD-M6-2 Robot Drive
  • Sigmatek CNC031 Positioning Module
  • Sigmatek TO161 Digital Output Module
  • Sigmatek CCL912 CPU PSU Module
  • Sigmatek ETV0821 Operator Terminal
  • SIGMATEK ET 261 Operator Terminal
  • SIGMATEK CP731-K Control Module 20-004-731-K
  • SIGMATEK ETEK Motherboard 12-250-021-K CM5V020
  • Sigmatek DEZ 181 DIAS Input Output Module
  • Sigmatek IPC111-D Industrial PC
  • SIGMATEK AKM54L-ANC2GBB0 Servomotor with Gearhead
  • SIGMATEK CTMS020 CM5V020 CNC Controller
  • DEMAG ERGOTECH 061 381 66 Sigmatek Control Unit
  • Sigmatek DAI 883 Module
  • Sigmatek ETV1521 Control Panel Installation Terminal
  • Sigmatek 9802.289.01 Board Control TA71 Display
  • Wittmann Sigmatek EU-252 proDrive W4 Servo Drive
  • Sigmatek CDM166 C-DIAS Module
  • Sigmatek DCP082 DIAS Central Unit
  • Sigmatek CCP081 C-DIAS Processor Module
  • Sigmatek MD111-1 Drive Module
  • Sigmatek ETV0821 Operator Terminal
  • Sigmatek ISE021 Interface Module
  • Sigmatek DCC080L Slide Control Module
  • Sigmatek AI075 Analog Input Module
  • SIGMATEK TO161 20-007-161 Module
  • SIGMATEK CIC011 Module
  • SIGMATEK AE0000318502 Hand Terminal Pendant
  • Sigmatek Krauss Maffei PC323-K Control Unit
  • Sigmatek Krauss Maffei PC321-K Control Cabinet PC
  • SIGMATEK CIV521 Control Module
  • SIGMATEK C-IPC-171 Industrial PC
  • SIGMATEK MDP101-L DIAS Drive Network Module
  • Sigmatek Krauss Maffei PC323-K Control Cabinet PC
  • SIGMATEK CRCH081 C-SLIDES Temperature Module
  • Sigmatek PC301-E6 Industrial PC SSD
  • Sigmatek SDI101 S-SLIDES Safety Input Module
  • Sigmatek CIV521 VARAN Control Module
  • Kollmorgen Sigmatek AKM42G-ANCNGBB0 Servo Motor
  • Sigmatek PC 521 Process Controller
  • Sigmatek Geode LX800 12-780-012 Industrial PC
  • Sigmatek STO081 S-DIAS Safety Output Module
  • Sigmatek SCP111 S-DIAS Safety CPU Module
  • Sigmatek CDI161 Industrial I O Module
  • Sigmatek Wiring Board V2 DIAS 05-250-023
  • Sigmatek CP102 20-004-102 S-DIAS CPU Module
  • SIGMATEK SLIDES CNC 115 Module
  • SIGMATEK DCC080 05-700-080-2 Control Module
  • SIGMATEK MDD 121 Drive Axis Module
  • SIGMATEK CIO011 C-DIAS Multi I/O Module
  • SIGMATEK CIV512 Servo Drive
  • SIGMATEK CM5V020 12-250-021-K Wiring Module