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 | 1478 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 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
  • Bonfiglioli LC 120 2 40 STD 80A1 CD Industrial Gearbox
  • SYN10 T 400 05 AF Bonfiglioli SYN10 Frequency Drive
  • 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