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 | 1460 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 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
  • Bonfiglioli MP080.1.7 Planetary Gearbox
  • Bonfiglioli VF-EP 49 BN-71-B2 Gearmotor
  • Bonfiglioli W75UD3010P80B14B3 Gear Reducer
  • Bonfiglioli W 110 U 100 P80 B5 B3 Worm Gearbox
  • Bonfiglioli ACT 201-11 FA Frequency Inverter 1.5kW
  • Bonfiglioli MP080380STDISS5 Planetary Gearbox
  • Bonfiglioli ACU 210-05 1 FA Frequency Inverter
  • Bonfiglioli BN63B4 Electric Motor 265 460V
  • Bonfiglioli BN 63 C 2 Electric Motor
  • Bonfiglioli 12.502.410 BCLP 40XDSM Assembly
  • Bonfiglioli ACU401-13FA Frequency Inverter
  • Bonfiglioli MP 130.2.20.15.16.40.80.100 Gearbox
  • Bonfiglioli VF49N60HSB3 Gearbox
  • Bonfiglioli VF30P Gearbox
  • Bonfiglioli ACU410-31A5 Inverter
  • Bonfiglioli 301L251.8 Gearbox
  • Bonfiglioli 8XNC63040004 Electric Motor
  • Bonfiglioli VF30F115P63B14B3 Gearbox
  • Bonfiglioli RAN 28/DA HS Right Angle Gear Unit
  • Bonfiglioli 300L220.1PCP90E Gear Unit
  • Bonfiglioli BN90LA4 Motor
  • Bonfiglioli KG2001030 Gear Unit
  • Bonfiglioli VF44F135P71B14B3 with VF30 Combination
  • Bonfiglioli W63 U P90B5 B3 Gear Motor 10:1
  • Bonfiglioli W75 U D30 15 P90 B5 B3 Gearbox
  • Bonfiglioli B310 DC Motor 600W 3000rpm
  • Bonfiglioli W 110 U 100 P80 B5 B3 Gearbox
  • Bonfiglioli VF44P120P71B5B3 Worm Gearbox
  • Bonfiglioli BN 71 B 2 Gearmotor VF44 F1 P71B14
  • Bonfiglioli 2E130136140005 Assembly Reference
  • Bonfiglioli KE0702030 Gearbox
  • Bonfiglioli ACT400-004A Frequency Inverter
  • Bonfiglioli W110 UFC1 P100 B14 B6 Gearbox
  • Bonfiglioli Vectron ZBA400-010FC Inverter
  • Bonfiglioli 700C-1H Final Drive Motor
  • Bonfiglioli VF 86 P Gearbox
  • Bonfiglioli W63 U 15 Gearbox
  • Bonfiglioli VF/W30/63U450P63B14B3 Gearbox
  • Bonfiglioli BN 63 A 2 Gear Motor
  • Bonfiglioli BN 63B 4 Motor
  • Bonfiglioli VF44P17 Gearmotor
  • Bonfiglioli T56BN/4 Asynchronous Motor
  • Bonfiglioli W63UF1P90B5 Worm Gearbox
  • Bonfiglioli ACU401-13FA Frequency Inverter
  • Bonfiglioli W63UFC1P90B5 Worm Gearbox
  • Bonfiglioli W75 1/50 D30 Speed Reducer
  • Bonfiglioli KG2401180 Non Standard Gearbox
  • Bonfiglioli ACU 201 07 FA Frequency Inverter
  • Bonfiglioli RAN25SA1HSB3 Gear Unit
  • Bonfiglioli SPL400 17F Industrial Drive 3.7kW
  • Bonfiglioli VF63P124P71B14B3 Worm Gearbox
  • Bonfiglioli W63U64P71B5B3 Worm Gearbox
  • Bonfiglioli BN90LA4FD Motor
  • Bonfiglioli ANG 410-33 6A Inverter
  • Bonfiglioli CM-CAN 149-650-034 179-675 140 Communication Module
  • Bonfiglioli WR110U120P90B5B3 Gearbox
  • Bonfiglioli C 112 F S05 Gearmotor with Pump
  • Bonfiglioli C50 2P P100 Gear Reducer
  • Bonfiglioli ACT 401-31A Inverter 30kW
  • Bonfiglioli A102UH25S1PV Gearmotor
  • Bonfiglioli ACT 201-05 FA Inverter
  • Bonfiglioli AGL402-21 3FA Inverter
  • Bonfiglioli VF49 V 71B14 Gearbox with ESA 6S 12 Motor
  • Bonfiglioli GVX2002-22-T Inverter 22kW
  • Bonfiglioli BN63A2 Electric Motor
  • Bonfiglioli EM I/O-03 I/O Module
  • Bonfiglioli C112 U P63 Inline Gearbox
  • Bonfiglioli BRA 400-075 BF2 Brake Chopper
  • Bonfiglioli VF49 P1 HSRB Worm Gearbox
  • Bonfiglioli GVX2000-18.5-T Inverter
  • Bonfiglioli BMD 118 14 3000 400 165 24 K 67 TC1 Drive
  • Bonfiglioli WR 86 U 120 P80 B5 V5 Gearbox
  • Bonfiglioli W110U56P100B5B3 Gear Reducer
  • Bonfiglioli A202 UR 35.4 Bevel Gearbox
  • Bonfiglioli ACU 401-26A Inverter
  • Bonfiglioli BN 71 B 4 Motor
  • Bonfiglioli Vectron BTD5-1870-05-400 Servo Motor
  • Bonfiglioli BE 80B 4 Motor with C122PP80 Gear
  • Bonfiglioli TR160225STD130ACD Gear Unit
  • Bonfiglioli W 63 U 24 P71 Gearbox
  • Bonfiglioli Trasmital KYB MHKAYABAKTMAGA050VP34 Hydraulic Track Drive
  • Bonfiglioli EM-ABS-01 Encoder Module
  • Bonfiglioli RPS Log 100 Data Logging Module
  • Bonfiglioli VF49P1P71B14 Gearbox
  • Bonfiglioli W86U Right Angle Gear Reducer
  • Bonfiglioli W63 U P71B5 Gear Reducer
  • Bonfiglioli W63UP90B5 Gearmotor
  • Bonfiglioli VER/S 400-150 Inverter
  • Bonfiglioli F202 H30 P80 Gearbox
  • Bonfiglioli W75UD307P90B14 Gearbox