Welcome to the Industrial Automation website!

NameDescriptionContent
HONG  KANG
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)

来源: | 作者:佚名 | 发布时间 :2023-11-21 | 762 次浏览: | 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) :

  • ABB ACS60401703 000C0000901 ACS600 VFD
  • ABB AS515 IMS Analog Input Module
  • ABB RED670 Line Differential Protection Relay Specs
  • ABB AC 800pec High-Speed Control System
  • ABB PP D113 B03-26-111600 3BHE023584R2647 Processor Unit
  • EATON XV-102-D6-70TWRC-10 Industrial HMI Panel
  • EATON XV-440-10TVB-1-1AI Analog Input Module
  • EATON XV-102-E8-57TVRC-10 Industrial HMI Panel
  • EATON XV-440-10TVB-1-1AI Analog Input Module
  • EATON DP-32DI/P-2X16 Digital Input Module
  • EATON XV-102-D0-57TVR-10 5.7-inch Touch Panel HMI
  • EATON LZMC2-4-A250 4-Pole Molded Case Circuit Breaker
  • EATON CG5V8GWUMUB611 Proportional Directional Valve
  • EATON PXR25V000L0AM Power Xpert Release Trip Unit
  • EATON FWJ-50A High Speed Ferrule Fuse
  • Eaton ELC-GP02001 HMI 2-inch Graphic Panel
  • Eaton 10316H1059 Replacement Filter Element
  • Eaton EEA-PAM-525-A-33 Proportional Amplifier Module
  • Eaton CG5V8GWUMUB611 Miniature Circuit Breaker 1P C 6A
  • Eaton PXR25V000L0AM PXR Trip Unit 250A
  • EATON HMCP100R3C Hydraulic Control Pump
  • EATON HMDLB3800T33W Hydraulic Motor
  • EATON DG4S4-018C-50 Directional Control Valve
  • EATON XV-102-H3-70TWRL-10 Industrial HMI Panel
  • EATON KRP-C-700SP Programmable Logic Controller
  • EATON XMW-OC-350-M10-4-300MM Flexible Copper Busbar
  • EATON HMCP400L5C Motor Circuit Protector
  • EATON EEA-PAM-561-A-33 Proportional Valve Amplifier
  • EATON 233-3279-003 Industrial Electronic Component
  • EATON DP-4000 IQDP4130 66D2040G03 Digital Meter
  • Eaton AV91AG0C010D AC Drive 7.5kW 400V
  • Eaton 70C1185R53 Control Relay 4PDT 10A 120V
  • Eaton F880-CR-PS Compact PLC Power Supply
  • Eaton MTL-644 Galvanic Isolator 4-20mA
  • Eaton 8811-IO-DC-01 Digital I/O Module 24VDC
  • EATON XV-152-E6-10TVRC-10 HMI Touch Panel
  • EATON LBD9900 Protection and Control Device
  • EATON B20098140711 A5 Industrial Control Module
  • EATON PVH057R01AA10 Hydraulic Piston Pump
  • EATON 7585T-8XE Industrial Managed Ethernet Switch
  • EATON TT-C5-LED-E1-WQ-BZ LED Lighting
  • EATON XV-303-70-C00-A00-1B Multi-Touch HMI
  • EATON T-1-M2-030-17-03-15 Industrial Component
  • EATON XV-102-E8-70TWRC-10 HMI PLC
  • EATON NZM2-XR208-240AC Remote Operator
  • Eaton 6N599-1 KNF7361 Limit Switch Industrial IP67
  • Eaton NZMS6-100/ZM6-100 MCCB 100A Thermal Magnetic
  • Eaton EEA-PAM-568-A-32 Proportional Amplifier Vickers
  • Eaton GHG7910201R0003 Ex Enclosure Flameproof ATEX
  • Eaton DILM300A-S 300A IEC Contactor
  • Eaton MTDUVR230V Undervoltage Release Module
  • Eaton 9210-6384-00p 200-240V UPS System
  • Eaton HKD3400F Molded Case Circuit Breaker
  • Eaton EVLSCX92101MT Lighting Control Module
  • Eaton XP-702-E0-84TSIJ-10 HMI Touch Panel
  • EATON PW9130I1500R-XL2U Rack UPS 1500VA Online Power Protection
  • EATON 9210-6384-00p Control Interface Module
  • EATON XC-CPU101-FC128K-8DI-6DO PLC Controller Module
  • Eaton EEA-PAM-535-A-33 Proportional Amplifier Control Module
  • Eaton EEA-PAM-535-C-33 Proportional Amplifier Module
  • EATON HFD3175 Series C Molded Case Circuit Breaker
  • EATON 92-01756-06 Specialized Power
  • EATON 2CLE-400X Current-Limiting Fuse
  • EATON XV-152-D6-10TVRC-10 HMI PLC
  • EATON 15-283-3096 Industrial Control Component
  • EATON XTOB0220LC1 Overload Relay
  • EATON DIL4M115230V50/60HZ Power Contactor
  • EATON 56450-410 Industrial Electronic Component
  • EATON CGE-02-3-21 Proportional Flow Control Valve
  • EATON 9078A67G04 Power Circuit Component
  • Eaton A200M2CX Motor Starter 45A
  • Eaton XC-CPU201 PLC 512K 8DI 6DO
  • Eaton XTCE580N22A Contactor 580A 22kW
  • Eaton MWI616 Industrial Workstation HMI
  • Eaton 4A55505H01 DC Power Supply Module
  • Eaton FD3150K Fixed MCCB 150A Circuit Breaker
  • EATON 9210‑6384‑00P 5P1550iR Rack UPS System
  • EATON ECN0702EHA Motor Starter Control Device
  • EATON KDB3300W 3-Pole Molded Case Circuit Breaker
  • EATON EEA-PAM-581-F-33 Programmable Automation Module
  • EATON XVS-460-15MPI-1-10 Touch Panel HMI
  • EATON HMCP400X5C Motor Circuit Protector
  • EATON DE1-124D3NN-N20N Variable Speed Starter
  • EATON PTE048-3Y101 Proportional Valve Amplifier
  • EATON 450U-E-L-440-W Photoelectric Sensor
  • Eaton 450U-E-L-440-W Wireless Ethernet Radio
  • Eaton NZMN3-AE630 MCCB 3P 630A Circuit Breaker
  • Eaton 7585DT-12 Industrial Display Monitor
  • Eaton HMI04BU01 Operator Interface Terminal
  • Eaton XV-102-B4-35TQRF-1AN HMI 3.5 Inch Touch Screen
  • EATON CLDC3600FK12P05Y04 DC Drive Controller for Industrial Motors
  • EATON 4A55505H01 Circuit Breaker for Industrial Power Systems
  • EATON PW9130I2000T-XL Online UPS Power Protection System
  • EATON XV-102-B3-35TQE-10 Industrial HMI Touch Panel
  • EATON XV-102-D6-57TVRC-10 HMI Touch Panel Operator Interface
  • EATON TA15CWBA-1AA04000 MTL Intrinsically Safe Barrier
  • EATON 9SX700I Online Double Conversion UPS
  • EATON B20098140711 Control Part
  • EATON 5277C13G09 Power Control Component Specifications
  • EATON FUE-563004 Industrial Control Module
  • Eaton EDR-3000-2C0IA1 Distribution Relay 5A
  • Eaton 10073074-001 TP08305543773 UPS Control Board Rectifier
  • Eaton NZMN3-AE630 Molded Case Circuit Breaker 630A
  • Eaton MFD-CP8-ME Expansion Module for MFD Series
  • Eaton HMCP400W5C Motor Circuit Protector 400A
  • EATON S801R13N3B Soft Starter Controller
  • EATON 66D2032GX1 5A MP3000 Motor Protection Relay
  • EATON XV-102-BE-35TQRC-10 HMI Touch Panel
  • EATON 9PX2200iRT3U Online UPS Power Supply
  • EATON 1785T-PMPS-1700 Power Management Control Module
  • EATON E05516-2134 Digital Input Eurocard
  • EATON XVS-460-15 MPI-1-10 Touch Panel HMI
  • EATON 0567-0753-0001 Industrial Control Component
  • EATON GHG5124407R0001 Explosion-Proof Plug 32A Data
  • EATON XV-102-E6-57TVRC-10 HMI PLC Technical Manual
  • Eaton 5-Y-41433-406-PD-Q-U Predetermined Counter
  • Eaton EEA-PAM-523-A-32 Vickers Proportional Amplifier
  • Eaton EX 1500 RT2U UPS 1.5kVA 1350W
  • Eaton PDG33M0175VFAJ Molded Case Circuit Breaker 175A
  • Eaton S801R13N3S S801+ Soft Starter 135A
  • EATON HLW3630 Industrial Circuit Breaker
  • EATON JGS316032G Industrial Fuse Holder
  • EATON NZMN3-4-AE400 Molded Case Circuit Breaker
  • EATON HKDB3250FT32W Molded Case Circuit Breaker
  • EATON WL-35717F Industrial Control Relay Module
  • EATON 9373-FB-PS-SS-040 Fieldbus Power Supply
  • EATON EL-5073E-T Industrial Lighting Control
  • EATON 9373-FB-PS-SS-040 Fieldbus Power Supply