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 | 1476 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) :

  • Bonfiglioli ACT401-19A Frequency Inverter
  • Bonfiglioli C102PP71 Gear Motor 13.4:1
  • Bonfiglioli C312 P P90 Speed Reducer
  • VEM K21R 71 G 4 Motor with Bonfiglioli VF44
  • Bonfiglioli C31 3 P P63 PV Bevel Gear Reducer V5
  • Bonfiglioli WR75UD28150P71B5B3 Gearbox
  • Bonfiglioli ACT401-13FA Frequency Inverter
  • Bonfiglioli VF62/P Worm Gearbox 38:1
  • Bonfiglioli ME210124001Y C Helical Gearbox
  • Bonfiglioli VF63PIP90BI4 Gearbox
  • Bonfiglioli ACT 401-19A Frequency Inverter
  • Bonfiglioli C102PP71 Variable Speed Gearmotor
  • Bonfiglioli C312 P P90 Reducer with Clutch
  • Bonfiglioli VF44 F1 10 Gearmotor with VEM Motor
  • Bonfiglioli C31 3 P P63 PV V5 Reducer
  • Bonfiglioli WR75UD28150P71B5B3 Gearbox
  • Bonfiglioli ACT401-13FA Frequency Inverter
  • Bonfiglioli VF 62/P Worm Gearmotor 38 to 1
  • Bonfiglioli ME210124001Y Inline Gearbox
  • Bonfiglioli VF63PIP90BI4 Worm Gearbox
  • Bonfiglioli VF86FC256 Worm Gearbox 1010B03004
  • Bonfiglioli VF44F1 Gearmotor 0.43kW 460V
  • Bonfiglioli W 75 UF1 D30 P80 B14 Gearbox i=100
  • Bonfiglioli VF63NP80B5 Worm Gearbox
  • Bonfiglioli 300R3133FPP80POG0A Gear Reducer
  • Bonfiglioli VF49F1N56C Gearbox
  • Bonfiglioli Trasmittal 300L19 Gearmotor with MEZ UD 1104 Motor
  • Bonfiglioli BCS30 Permanent Magnet Motor with Encoder
  • Bonfiglioli BN56B4 Gearmotor with VF30 Reducer
  • Bonfiglioli VF44 Gearbox 100480150
  • Bonfiglioli VF63PIP90B14 Gearbox
  • Bonfiglioli 830420150 BN63A4 230/400-50 IP55 CLF B14 with VF30F2 P63B14B3-I40
  • Bonfiglioli BN63A2 Motor
  • Bonfiglioli VF44 ALP63B5 Gearbox
  • Bonfiglioli A102 UR P80 Gearbox
  • Bonfiglioli MP 105 2 16 STD 95A1 CD 19 S1 OR SB KE Planetary Gearbox
  • Bonfiglioli T56BN/4 Motor
  • Bonfiglioli 8E20020594-M285018 Motor
  • Bonfiglioli VF49 V P71 B5 Gearbox
  • Bonfiglioli X VFR49 L1 FA1 180 P63B5 B3 Gearbox
  • Bonfiglioli W63U7P90B14V6 Right Angle Gear Reducer
  • Bonfiglioli VF/W30/63UFC2 Gear Reducer i=168
  • Bonfiglioli VF44 Gear Reducer 100480150
  • Bonfiglioli ACU 201-07 FA Frequency Converter
  • Bonfiglioli BN-80B-4 Motor with VF63 Gearbox 38:1
  • Bonfiglioli MVF 49 Gear Reducer for Servo Motor
  • Bonfiglioli ACT 400-034 A Frequency Inverter 11kW
  • Bonfiglioli SYN10-S-220-03-AF AC Drive 0.5HP
  • Bonfiglioli LC 090 1 7 STD FM CD 19 KE Gearbox
  • Bonfiglioli TQFK070350GR80A1CD Gear Unit
  • Bonfiglioli BN 80 B6 FD Three Phase Motor
  • Bonfiglioli W63U Worm Gear Reducer
  • Bonfiglioli 830G2310M-B048052 Gear Motor
  • Bonfiglioli VF49P128P71B5B3 Worm Gearbox
  • Bonfiglioli W75UD30719/140B3 Worm Gearbox
  • Bonfiglioli VF49F17HSB3 Worm Gearbox
  • Bonfiglioli C12 2P 20.6 P90 B3 Gearbox
  • Bonfiglioli BN80B4 623136 Geared Motor
  • Bonfiglioli 4APC3-4 9142882 Geared Motor 0.18 kW
  • Bonfiglioli W86 80/90-B5 Worm Gear Reducer 20:1
  • Bonfiglioli ACU 210-07 1 FA PLC Peripheral Module
  • Bonfiglioli MVF44/F Worm Gearbox
  • Bonfiglioli W63U Worm Gear Reducer
  • Bonfiglioli BN63A2 Electric Motor
  • Bonfiglioli BN 132 M B 4 Electric Motor 9.2kW
  • Bonfiglioli VF49 L1 P1 P63B5 Worm Reducer i=45
  • Bonfiglioli C413 P S2 7717/1000 Gearmotor 1.5kW
  • Bonfiglioli VF49F1P63B5B3 Worm Gearbox
  • Bonfiglioli BTD5-1870-05-400-ENC8A Servo Motor
  • Bonfiglioli ACU401-03FA Frequency Inverter
  • Bonfiglioli MVF63/N Gearbox with AEG Servomotor
  • Bonfiglioli BN80A4 Gearmotor VF49L1P1P80B14
  • Bonfiglioli VFR 72/FC2 Gear Reducer
  • Bonfiglioli W R 86 U 120 Gearbox Assembly
  • Bonfiglioli W 75 U 30 Gear Reducer
  • Bonfiglioli W R 86 U 120 P80 B5 V5 Gearbox
  • Bonfiglioli RAO 50/DC Gearbox
  • Bonfiglioli VF49 F1 P63B5 Gearmotor with SPZ MS6324
  • Bonfiglioli X_LC 090 Planetary Gearbox
  • Bonfiglioli A302 UH35 P90 Gearbox
  • Bonfiglioli VF63FCHS Worm Gearbox 103100390
  • Bonfiglioli VF 44 P63 B14 Gearbox M00480210008
  • Bonfiglioli MPD1006S0006 Precision Planetary Gearbox
  • Bonfiglioli VF49F1N56C Worm Gearbox
  • Bonfiglioli TR G 105 3 20 STD Planetary Reducer
  • Bonfiglioli VFR49P1P63B5 Worm Gearbox
  • Bonfiglioli WR 86 U 120 P80 B5 V5 Gearbox 2G30013944
  • Bonfiglioli BRA 400-060 BF2 Brake Chopper
  • Bonfiglioli VF49P P71B5 Worm Gearbox
  • Bonfiglioli C402 P VG1 Gear Speed Reducer 31.4:1
  • Bonfiglioli ISMET LCVT050 DK308/50 Line Reactor
  • Bonfiglioli C 22 2 F GR063 Gearbox
  • Bonfiglioli C31 3 P P63 PV V5 Reducer
  • Bonfiglioli CM-485 T Communication Module
  • Bonfiglioli W75UF1D30P90B5 Gearbox
  • Bonfiglioli BN63 B4 VF49 Gearmotor 0.18kW
  • Bonfiglioli ACT 400-004 FA Frequency Inverter
  • Bonfiglioli W110U100P90B5B3 Worm Gearbox
  • Bonfiglioli SYN10 T 400 05 AF Inverter
  • Bonfiglioli MP080.1.4.15.16.40.80.100 Gearbox
  • Bonfiglioli SYN10S Inverter
  • Bonfiglioli VF44L2P160 Gearmotor
  • Bonfiglioli W 86 U 40 P90 B5 B3 Gear Reducer
  • Bonfiglioli BTD5-1870-05-400 Servomotor
  • Bonfiglioli MP 080 2 2C Gearbox with BLDC Motor
  • Bonfiglioli MP080.1.10 Planetary Gearbox
  • Bonfiglioli C212PHS Reducer
  • Bonfiglioli MVF 49F1 Gearbox with ICME T71B4
  • Bonfiglioli VF 49 v P71 B5 Gearbox
  • Bonfiglioli VF 44 P1 Gearmotor
  • Bonfiglioli C 22 2 NP 6.1 Helical Gearbox
  • Bonfiglioli F203 316.9 Gearbox with Kaiser Motor
  • Bonfiglioli SYN10 S 220 07 AF Frequency Inverter
  • Bonfiglioli 301L251.8-HC-P90 Gearbox 1/51.8
  • Bonfiglioli ACT401-25A Frequency Inverter
  • Bonfiglioli W75 U D30 30 P90B14 B3 Worm Drive
  • Bonfiglioli 830G2310M-307638 Motor
  • Bonfiglioli C112-P-P90 Inline Gearbox i=6.2
  • Bonfiglioli SYN10-S-220-03-AF AC Drive
  • Bonfiglioli VFR49 A HS Worm Drive i=180 B3
  • Bonfiglioli ACT 401-29 A AC VFD Drive 22kW
  • Bonfiglioli VF49PIP63B14 Gearbox
  • Bonfiglioli ANG 410-18 2 FA Inverter
  • Bonfiglioli GVX2000-7.5-T Converter
  • Bonfiglioli EM-ENC-02-24 Optical Module
  • Bonfiglioli ACT 401-33 A VFD Drive
  • Bonfiglioli MVF 49F1 Gearbox with ICME T71B4
  • Bonfiglioli BN112M4 Motor