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 | 1483 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 BN71B4 MVF49 F1 Gearmotor i=36
  • Bonfiglioli BN 63 B6 Gear Motor 0.12kW
  • Bonfiglioli SPL400 17F SynPlus Drive 3.7kW
  • Bonfiglioli ACU 401-25A Frequency Inverter
  • Esa 3M2209B5 M71Q Motor with Bonfiglioli MVF49 Gearbox
  • Ferag 5690512 UIKER TR90L4 Gear Motor with Bonfiglioli C212
  • Bonfiglioli A302 UH35 P90 Bevel Gearbox
  • Bonfiglioli GVX1000-1.5-S Inverter Drive 1.5kW
  • Bonfiglioli W63 U 15.0 P80 B14 B Worm Drive
  • Bonfiglioli KP500 Control Panel
  • Bonfiglioli C302PP71 Speed Reducer
  • Bonfiglioli BN71B4 Motor con MVF49 Reductor
  • Bonfiglioli BN71B4 Motor with MVF49 Gearbox i36
  • Bonfiglioli SYN10S 22001AF Inverter 0.2 kW
  • Motor Power Esa 3M2209B5/M71Q with Tachometer and Bonfiglioli MVF49 Gearbox
  • Bonfiglioli SYN10 S 220 01 AF Inverter
  • MEZ UD 1104 2.5 kW BONFIGLIOLI Trasmittal 300L19 Gear Motor 300L19.00HZP90AW0A
  • Bonfiglioli Vectron ACT W 401-39 D Inverter
  • Bonfiglioli BN27C4 Gear Motor 0.09 kW
  • Bonfiglioli A302 UH40 P90 Gear Reducer
  • Bonfiglioli ACT410-193FA Frequency Inverter 5.5kW
  • Bonfiglioli VFR49 P1 240 P63 B5 B3 Gearbox
  • Bonfiglioli BN 63A 6 Motor with VF30 Combination
  • Bonfiglioli VF44 FA1 P63B14 Reducer i=60
  • Bonfiglioli BN 80 B6 FD Electric Motor
  • Bonfiglioli MVF 49F1 Reducer with ICME T 71 B4 Motor
  • Bonfiglioli BN 27 C 4 Gearmotor 0.09kW
  • Bonfiglioli MP 080 Servomotor MPC2012S000F
  • Bonfiglioli S101 1 P P71 Gear Reducer i=4.7
  • Bonfiglioli 301L251.8-HC-P90 Gearbox
  • Bonfiglioli RFI Filter F1060800-SEFL-E9S
  • GE Aviation 9410M37P01 Motor Drive Core
  • Bonfiglioli VF44 FA1 P63B14 Gearbox 60 to 1
  • Bonfiglioli K63A4 Motor 8D09020032
  • Demag 4APB71-4-G08-PR Gear Motor 0.37 kW
  • Bonfiglioli BN90LA4 Gear Motor 1.5 kW
  • Bonfiglioli VF49A-28-P80-B14 Gearbox
  • Bonfiglioli MP053 Planetary Gearbox MPA2028S000D
  • Bonfiglioli C312 P P100 Gearbox
  • Bonfiglioli S1011PP71 Gearbox 4.7 to 1
  • Bonfiglioli VF 44 V 7 P63 B5 B3 with V 0.25 F D11
  • Bonfiglioli DW3000210 AX160 Motor Gearbox
  • Bonfiglioli ACT 401-13 FC Frequency Inverter 2.2kW
  • Bonfiglioli C222 P 7.1 P90 B3 Gearbox
  • Bonfiglioli BN90S4 Motor with C212 Gearbox
  • Bonfiglioli MP130.2.9.15.24.50.130.165.S1 Gearbox
  • Bonfiglioli VF110 V HS Worm Gearbox
  • Bonfiglioli BN7IA4 Electric Motor
  • Bonfiglioli ACU 401-23A Frequency Converter
  • Bonfiglioli BN63B4 Gearmotor
  • Bonfiglioli LC12210S490002 Gear Reducer
  • Bonfiglioli BN63A4 Geared Motor with VF49
  • Bonfiglioli WR86U120P80B5B3 Gear Reducer
  • Bonfiglioli MPB1006S000C Planetary Gearbox
  • Bonfiglioli GC000011 Frequency Inverter
  • Bonfiglioli VF44 FA1 P63B14 Gearbox 60 to 1
  • Bonfiglioli BN63B6 Gear Motor 0.12 kW
  • Trasmital Bonfiglioli 301 L2 Gear Reducer
  • Bonfiglioli BN71B4 Motor with MVF49 Gearbox
  • Bonfiglioli MVF62/A Worm Gear Motor 7 to 1
  • Bonfiglioli VF W30 63UFC2 Gear Reducer
  • Bonfiglioli S1011PP71 Gearbox 4.7 to 1
  • Bonfiglioli W63 U7 P90B14 V6 Gear Reducer
  • Bonfiglioli BN63B6 FD Geared Motor with VFR49F1P63B5 Reducer
  • Bonfiglioli T56BN/4 Three Phase Motor
  • Bonfiglioli MVF62/A Worm Gearbox 7 to 1
  • Bonfiglioli VF44 FA1 P63B14 Gearbox 60 to 1
  • ICME T71B4 Motor with Bonfiglioli MVF49F1
  • Bonfiglioli BN71B4 Motor with MVF49 Gearbox
  • Bonfiglioli C31 3P P63 PV V5 Gear Reducer
  • Bonfiglioli BN80B4 Electric Motor 8F31020004
  • Bonfiglioli VF/W30/63UFC2 Gear Reducer i=168
  • Bonfiglioli MPD1006S0006 In-Line Planetary Gearbox
  • Bonfiglioli LC 120 2 40 STD 80A1 CD Gearbox
  • Bonfiglioli Vectron ZBA400-010FC Brake Unit
  • Bonfiglioli VF44 U14 Worm Gearbox B03181367918
  • Bonfiglioli 8XNC63040004 Electric Motor IP55
  • Bonfiglioli W110U P100B5 Worm Gearbox
  • Bonfiglioli VF63/FC1 P80 Gearbox 203160152 i=15
  • Bonfiglioli VMN JB00017191 Gear Unit
  • Bonfiglioli AGL202-031FC Inverter 0.37 kW
  • Bonfiglioli BN71B2 Geared Motor with VF44
  • Bonfiglioli S1011PP71 Gearbox 4.7:1
  • Bonfiglioli VF W30 63UFC2 Gear Reducer
  • Bonfiglioli VF44FA146HSB3 Gear Reducer
  • Bonfiglioli MP105 Planetary Gearbox 18:1
  • Bonfiglioli VF49 L1 P1 P63B5 Worm Gearbox
  • Bonfiglioli 55aN-4 Electric Motor
  • Bonfiglioli W63UF1100N56CB3 Gear Reducer
  • Bonfiglioli A302NUH-52.7N145TC Gear Reducer
  • Bonfiglioli VF49 L1 P1 P63B5 Worm Reducer i=45
  • Bonfiglioli MPD1006S0006 Precision Planetary Gearbox
  • Bonfiglioli SYN10S22007AF Frequency Drive 7.5A
  • Bonfiglioli VF44 U14 Worm Gearbox B03181367918
  • Bonfiglioli CM-485-T Communication Module
  • Bonfiglioli W75 UF1 D30 P80 B14 Gearbox i=100 B6
  • Bonfiglioli VF44 ALP63B5 Industrial Gear Reducer
  • Bonfiglioli 8XNC63040004 Electric Motor IP55
  • Bonfiglioli ACT201-11FA Frequency Inverter
  • Bonfiglioli BN56B4 Gearmotor VF30F1P56B5 1650RPM
  • Bonfiglioli SYN10-T-400-05-AF Drive
  • Bonfiglioli AGL402-071FA Inverter
  • Bonfiglioli BN90LA4-BA Brake Motor
  • Bonfiglioli MPD1006S0006 Planetary Gearbox
  • Bonfiglioli BCS40 Permanent Magnet Motor
  • Bonfiglioli WR110U192 Gear Reducer
  • Bonfiglioli VF44 U14 B03181367918 Worm Gearbox
  • Bonfiglioli VFR49 P1 Gear Reducer
  • Bonfiglioli A102USSC95B Helical Gearbox
  • Bonfiglioli BN71C4 AC Motor 0.75 kW
  • Bonfiglioli VF63 V P80B5 Worm Gearbox
  • Bonfiglioli SPL400 23F SynPlus Inverter 11kW
  • Bonfiglioli RAN 24/SB B3 Bevel Gearbox 1:1
  • Bonfiglioli VF110 FC1 P100 B14 B6 Gear Reducer
  • Bonfiglioli Vectron KP500 Keypad 179675500
  • Bonfiglioli MVF 62/F Worm Gearbox i=45
  • Bonfiglioli BN56B4 Gearmotor with VF30F1P56B5
  • Bonfiglioli SYN10S 22001AF IP65S Inverter
  • Bonfiglioli Engineering 2B HMI Touch Panel 12 Inch
  • Bonfiglioli BN 71 B 2 VF44 F1 P71B14 Gearmotor
  • Bonfiglioli VF49 L1 P1 P63B5 Gearbox 45:1
  • Bonfiglioli BN56B4 Gearmotor with VF30
  • Bonfiglioli WR86U138P80B5B8 Gear Reducer
  • Bonfiglioli BN27C4 Gear Motor 0.09 kW
  • Bonfiglioli Vectron ACT401-19FA Inverter
  • Bonfiglioli 8E35020568-752623 Motor
  • Bonfiglioli MP105 Planetary Gearbox 40:1
  • BONFIGLIOLI VECTRON BTD5-1870-05-400-ENC8A-PA08-CA12-X