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

  • SIGMATEK PC321K Industrial Computer
  • SIGMATEK MDP 102-1 SLIDES Power Module
  • SIGMATEK TAE-151 12-200-151 Light Terminal
  • SIGMATEK CP102 20-004-102P6995B HMI Panel
  • SIGMATEK CAM-123 12-017-123-C Analog Mixing Module
  • SIGMATEK DCC041 DIAS Compact Controller
  • SIGMATEK DVI021 and DKL015 DIAS Power Module
  • SIGMATEK SDD340-46 SDD Series Servo Drive
  • SIGMATEK Robotdrive L6 02220-7997 Engel Drive
  • SIGMATEK AKM63M-ANCNGBB0 4.38kW PM Servomotor
  • Sigmatek SDD 310 SLIDES-Drive SDD310-4O
  • Sigmatek SDD335-23K Drive VARAN Interface 14kVA
  • Sigmatek TAE1922-K Touch Display Unit
  • Sigmatek DIAS DCP 643 CPU Module DKL003
  • Sumitomo CNH-4105Y-43 NSNP Gear Reducer
  • Sumitomo CHHP-4160Y-35-213T Inline Gear Reducer
  • Sumitomo CNHM02-6090YA-87 NSNP Gear Motor
  • Sumitomo CNVXS-6100Y-43 NSNP Gear Reducer
  • Sumitomo CNHM2609511 Gear Motor
  • Sumitomo CHVM3-6130-B-35 Gear Motor
  • Sumitomo HW0389042-A Industrial Component
  • Sumitomo F2CF-W55-ZG05-64 Gear Reducer
  • Sumitomo CHH-6165Y-13 Inline Gear Reducer
  • Sumitomo CNVM3-6125C-EP-6 Cyclo Gear Motor
  • Sumitomo RNYX-1320Y-20 Gear Reducer
  • Sumitomo XFCG111-43/24/165 Control Component
  • Sumitomo LHYJ-3A105K-Y3-102 Gear Reducer
  • Sumitomo CNFM02-6095DA-B-121 TC-FX/FB-02A Motor
  • Sumitomo CNHJ-4105DAY-289 NSNP Gear Reducer
  • Sumitomo LHYJS-4C145Y-Y1-112 NSNB Gear Reducer
  • Radiator 2060351111 Komatsu Sumitomo Linkbelt
  • Sumitomo BL3-09B-35MEHDK6 Gearbox ANFJ-L30
  • Sumitomo Truninger 8H1-150 Internal Gear Pump
  • Sumitomo RNFMS01-25R-B-150 200V NSNP Gearmotor
  • Sumitomo CHHBJN1HA-6135Y-29 Inline Reducer
  • Sumitomo EHYMS5-B6125YA-Y3-74 NSNB Reducer
  • Sumitomo Eaton H-050AA2F-J Orbit Motor
  • Sumitomo TC-FXVP Motor 0.75kW 4P 400V N-80M
  • Sumitomo XFCG111-87/24130 Industrial Control Component
  • Sumitomo AF3122-030 Inverter 30kW 3Ph 200V
  • Sumitomo QT42-25FS-B Internal Gear Pump
  • Sumitomo F2CS-A35-ZG09-59 Speed Reducer
  • Sumitomo CNHM05-6090-B-29 Gear Motor
  • Sumitomo CHHJ-6145Y-29-210T Gear Reducer
  • Sumitomo E3P-20-2.2-S1450-E Hydraulic Pump
  • Sumitomo RNYMS1-1420C-AV-20 Right Angle Gear Motor
  • Sumitomo SR101 SRKG101-76-40-060 Reamer Head
  • Sumitomo RNYM05-1220-25/UBAABB Gear Motor
  • Optidrive E3 Sumitomo GHB-36 Vector Inverter Motor
  • Sumitomo CNH-614HY-35 UNMP Gear Reducer
  • Sumitomo CNH-612HY-6 SM-Cyclo Gearmotor
  • Sumitomo HF3214-A75 Electric Motor
  • Sumitomo CNVM02-6100-B-59 NSMP Gear Reducer
  • Sumitomo CNHJ4105Y35 NSNP Gear Reducer
  • Sumitomo CHH6165Y-29 NSNB Gear Reducer
  • Sumitomo RNYM1-1420-25 Hyponic Gear Motor
  • Sumitomo T600C Industrial Control Unit
  • Sumitomo LHH-4A115-K2-28 NSNB Gear Reducer
  • Sumitomo RNYM02-1220-AV-20 Speed Reducer
  • Sumitomo CHHS-6140Y-SB-17 Gear Motor
  • Sumitomo Heavy Industries SSE-100A-RM Drive Unit
  • Sumitomo PA228771 CNHM2-6100YB-EP-8 Gear Motor
  • Sumitomo RNYM02-1231-B-50 Speed Reducer
  • Sumitomo CNFM1H-6090-6 Induction Motor
  • Sumitomo CHH-614HY-11 Gear Reducer
  • Sumitomo F4C-D25-ZG01-41 Speed Reducer
  • Sumitomo PA224280 CNHM1-6095YC-EP-21 Gear Motor
  • Sumitomo KHYJB4115K185145TC Gear Motor
  • Sumitomo LHYJS-3A105Y-Y1-179 NSNB Gearmotor
  • Sumitomo AF3102-022 BN AC Driver
  • Sumitomo SG75M-H Operator Panel
  • Sumitomo NT2014-2A2 NSNP Control Unit
  • Sumitomo RNYMS03-1320-B-60 Gear with Motor
  • Sumitomo F90L/4 F90L4 Drive Motor
  • Sumitomo TC-FX NSMP Motor Unit
  • Sumitomo RNYM05-1210-7 NSMP Gearmotor
  • Sumitomo Fine Cyclo F2CFS-C45-59 Gearbox
  • Sumitomo Heavy Industries SSE-50A Industrial Unit
  • Sumitomo CHH-6130Y-17 NSNB Gear Reducer
  • Sumitomo UMC556000-02 Control Unit
  • Sumitomo CHHJ-4155Y-87 Inline Gear Box
  • Sumitomo ANFXS-P120F-M30GLD-5 NSNP Reducer
  • Sumitomo CNHJ-6095Y-17 NSNP Gear Reducer
  • Sumitomo H-3115 17:1 USNT Gear Reducer
  • Sumitomo CHH 6135Y USNTC02 Gear Reducer
  • Sumitomo JA450918A2 45JA918A Cylinder Head
  • Sumitomo SD4SGS-ACB-02C-110-54 Solenoid Valve
  • Sumitomo CNVMS02-6100DAYA-231 NSMD Gear Reducer
  • Sumitomo CHH4135Y8 NSMD Inline Gear Reducer
  • Sumitomo PA020201 CNH-6125Y-87 Worm Gear Reducer
  • Sumitomo Connectivity 8100-2730 Connector
  • Sumitomo CNHJ-6120Y-87 PA021857 NSNB Gear Reducer
  • Sumitomo RNYM02-1330-B-100 Induction Gear Motor
  • Sumitomo JA762913AC Operator Interface Keypad
  • Sumitomo CQT51-100FV-S1262J-A Coolant Pump
  • Sumitomo PA225389 CNHM1-6095YC-EP-6 Gear Motor
  • Sumitomo CHHJ-4130Y-43 NSNB Gear Reducer
  • Sumitomo RNYJ-1520Y-12 NSNB Gear Reducer
  • Sumitomo HC1480-29.00 NSMD Inline Gear Reducer
  • Sumitomo MC-550 MCU UMC550000AEG01
  • Sumitomo CNVM1H-6125YA-B-87 Gear Reducer
  • Sumitomo SD4GS-ACB-02B-110-54 Solenoid Valve
  • Sumitomo HCS79310 Main Motor Assembly
  • Sumitomo JA762913AC Operator Interface Keypad
  • Sumitomo CNHJ-6125Y-8 In Line Reducer
  • Sumitomo X120D30303T-01 Driver
  • Sumitomo H1Y203-25-F7000 Shaft Mount Reducer
  • Sumitomo Type-35SE Fiber Fusion Splicer Kit
  • Sumitomo F2CS-T655-171 Cyclo Drive Gearbox
  • Sumitomo F80 Adsorber RX19ZT6124
  • Sumitomo MC-550 MCU UMC550000AKG01
  • Sumitomo Drive FCS-A65G-59 Speed Reducer
  • Sumitomo SRA81-56-BM50-140 Modular Reamer Holder
  • Sumitomo CNHM05-6100YA-59 Gear Motor
  • DEMAG Sumitomo Ergocontrol NC4 100 V7 Control Unit
  • Sumitomo HMV02-207 Cyclo Drive Induction Motor
  • SUN-EH Sumitomo Z4-22172-12 Ozone Power Unit
  • Sumitomo AF-500 AF502-2A2 Transistor Inverter
  • Sumitomo T-82C+ Core Alignment Fusion Splicer
  • Sumitomo P741F6002B Circuit Board
  • Sumitomo AS-3211 Injection Molding Motherboard
  • Yaskawa SGMGH-13Q5A-OM11 Servo Motor with Sumitomo F3CS-A25G-59 Gear
  • Sumitomo SH120-5 Final Drive Track Travel Motor
  • Sumitomo AS-3345 Circuit Board
  • Sumitomo AF300S-1A5-E Transistor Inverter 1.5kW
  • Sumitomo Type-Q101-CA SM MM Fiber Fusion Splicer
  • Sumitomo SH50 NIV Operator Panel
  • Sumitomo RNFM-009-17L-B-120-N4FCZ843 AC Gear Motor