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

  • Bosch Rexroth CSH01.1C-PL-EN1 Control Unit R911318507
  • Rexroth 4WRE 10 E32-14/24Z4/M Servo Valve
  • Rexroth MSK040C-0600-NN-M1-UG0-NNNN Motor R911306060
  • Rexroth 30mm Ball Screw Assembly 10mm Pitch
  • Rexroth VT 11013-12 Amplifier Module R900010960
  • Rexroth MTC-R01.1-M1-A2-FW Control Unit R911279076
  • Bosch Rexroth SD301 Display Touchscreen 0608830194
  • Rexroth FWA-ECODR3-SMT-02V44-05 Firmware Module
  • Bosch Rexroth CSH01.1C-PL-EN1 Control Unit R911318507
  • Rexroth Star Starmatic 1465-400-00 Direct Drive
  • Rexroth AOK-032-NN-1 R054701796 Compact Module
  • Rexroth EFC5610-7K50-3P4-MDA-7P 7.5 kW Drive
  • Rexroth CSB02.1A-ET-EC-NN-NN-NN-NN-FW R911338329
  • Rexroth 3 842 559 001 VA2/D-130 Slide Stop
  • Rexroth Rod 429/1000 Linear Encoder R911220876
  • Rexroth DAQ02.1M Analog Module Board FJ159
  • Rexroth CSH01.1C-SE-ENS-NNN-NNN-S1-S-NN-FW Board
  • Rexroth HCS01.1E-W0008-A-03-E-S3-EC-NNN-NN-FW Drive
  • Rexroth HMS01.1N-W0150-A-07-NNNN Power Section
  • Rexroth RQN425-A-M-0512 PQ4752 Rotary Encoder
  • Rexroth VT5001 S23 R5 Proportional Amplifier
  • Rexroth DKCXX.3-040-7 Drive Controller
  • Rexroth MSM030C-0300 Servo Motor with Transmission
  • Baumüller DSG 56 M25 Servo Motor RE-21-1-A05
  • Rexroth RF13-04 Encoder Resolver Circuit Unit
  • Bosch Rexroth CML65.1 Control Module R911170460
  • Mannesmann Rexroth VT11131-11 Amplifier
  • Rexroth 3-609-929-B33 Electric Runner Nut
  • Rexroth VT3014S36 VT-3014 Amplifier Card
  • Rexroth RKB0044/030.0 Cable R911346854
  • Rexroth HMD01.1N-W0020 R911305062 Double Servo Drive
  • Rexroth HCS01.1E-W0008-A-03-B-ET-EC-NN-NN-NN-FW Drive
  • Rexroth R900424277 DBDS20P1X/200 Overflow Valve
  • Rexroth R185361310 Runner Block Ball Bearing
  • Rexroth AZPB32-1.0RCP02MB Gear Pump 0510010008
  • Rexroth PR2100.1 Embedded Automation Computer
  • Rexroth SE-B2.030.030-14.000 Servo Motor
  • Rexroth R900579497 VT 5035-17 Amplifier Card
  • Rexroth VT3024-S34-R1 Amplifier Card
  • Rexroth R978905565 Directional Control Valve
  • Rexroth KE312 Communication Module 0 608 830 241
  • Rexroth DBETX-10/250G24 Valve R901429019
  • Rexroth R-ILB PB 24 DI16 DO16 Profibus Module
  • Rexroth VT-5014S30-R1 Amplifier Card VT5014S30R1
  • Rexroth Indramat HDS03.2-W100N Servo Drive
  • Rexroth 0-531-012-740 Bladder Accumulator
  • Rexroth DAG01.2M EP Encoder Interface R911307482
  • Bosch Rexroth KE312 Communication Module 0608830241
  • Rexroth VT 11118-10 Analog Amplifier Module
  • Rexroth CML10.1 IndraControl L PLC R911170722
  • Rexroth 4WE6J62/EG24NK4K R901050676 Valve
  • Rexroth PPC-R22.1N-N-Q1-NN-NN-FW Servo Controller
  • Rexroth R162449420 Linear Guide Rail Component
  • Rexroth VT 5041-21/3-OC Amplifier Card
  • Bosch Rexroth R911173255 S20-PSDO-8/3 Interface Module
  • Bosch Rexroth Schraubspindel 0608701002 / 0608720039 / 0608820071 35 Nm Spindle
  • Rexroth CSB01.1C-SE-ENS-EN2-NN-S-NN-FW Control Board
  • Rexroth R167139410 Linear Guide Rail
  • Rexroth 0 608 701 017 Nutrunner Servomotor
  • Rexroth CML40.1-NP-220-NA-NNNN-NW IndraControl L40
  • GE MVDL8 00-479 3110 1-A Drive Control Board Module
  • GE ALSTOM EC5 Electro Code 5 Colorlight Track Circuit
  • ALSTOM ICP 232 Controller Module 029.359325
  • ALSTOM ZP0020001MM Ethernet and Communications Card
  • ALSTOM MV7306P21 VP32702X PROFIBUS Fieldbus Coupler
  • Bosch Rexroth CML10.1-NN-210-NB-NNNN-NW IndraControl L10 PLC
  • Bosch Rexroth R911173255 S20-PSDO-8/3 Safe Digital Output Module
  • Bosch Rexroth MSM040B-0300-NN-M0-CC1 Servo Motor
  • Bosch Rexroth MSK040B-0450-NN-M1-UG0-NNNN Servo Motor
  • Bosch Rexroth 3630630010 3/2 Way Directional Control Valve
  • Bosch Rexroth IndraControl S20 R911173359 S20-PN-BK+ Bus Coupler
  • Bosch Rexroth MKD041B-144-GP0-KN Synchronous Servo Motor
  • Bosch Rexroth Indramat BT 100 Industrial Panel PC
  • Bosch Rexroth MSM019B-0300-NN-M5-MH1 Servo Motor
  • Rexroth SE-B5.700.020-10.000 Synchronous Servo Motor
  • Rexroth 0608820115 Nutrunner Torque Transducer Size 4
  • Rexroth MAC090A-0-ZD-5-C/110-A-0/KI520LV Servo Motor
  • Rexroth 4WMM6J53/N Directional Control Valve
  • Rexroth HCS02.1E-W0028 IndraDrive Base Unit
  • Rexroth MDD090B-N-030-N2M-110GB0 Servo Motor
  • Mannesmann Rexroth VT11025-16 Amplifier Module 19666
  • Rexroth HCS01.1E-W0008-A-03-B-ET-EC-NN-L4-NN-FW Inverter
  • Rexroth MDD093C-N-030-N2M-110GB0 Servo Motor
  • Rexroth R162211322 Linear Guide Slider
  • Rexroth IndraControl L40 CML40.2-NP-330-NA-NNNN-NW Controller
  • Rexroth 3 842 532 421 Geared Motor 1380 rpm
  • Rexroth 4WEH 16 E67 Directional Valve Set
  • Rexroth HMS01.1N-W0110-A-07-NNNN Inverter
  • Rexroth P-057429-00000 Repair Kit
  • Rexroth MSM031C-0300-NN-M0-CH0 Servo Motor
  • Mannesmann Rexroth VT 11013 Amplifier Module
  • Rexroth 4DMC160 Transducer 0608820115
  • Rexroth 990500A Industrial Component
  • Bosch Rexroth HCS01.1E-W0003 Compact Drive
  • Rexroth 4WMM10E31/V Directional Valve R900593552
  • Bosch Rexroth EMC-032-NN-2 R021U10021 Linear Actuator
  • Rexroth VT-MX-4-10/K-AX4U-V50 Servo Interface Module
  • Rexroth 0811405144 Amplifier Card
  • Rexroth VM310 0608760109-103 Power Module
  • Rexroth HMD01.1N-W0012 IndraDrive Power Section
  • Rexroth LT303 0 608 750 084 Servo Amplifier
  • Rexroth DKCXX.3-040-7 Servo Drive 40 A
  • Rexroth 3842999760 UM 1 Return Module
  • Rexroth R911172284 Safety Controller SLC-3-CPU000300
  • Rexroth IMS2A-KWD-025-SNS-C1 R051702883 Measuring System
  • Rexroth NK350S Network Coupler MRN 3608877368
  • Bosch Rexroth CSB01.1N-AN-ENS Control Section
  • Rexroth R911330523 Power Cable RKL0045
  • Rexroth HMS01.1N-W0036 Single Axis Inverter
  • Rexroth 0 608 740 103 Connection Cable 2 m
  • Rexroth RWD-025-SNS-C2-P-2 Linear Bearing Block
  • Rexroth MSK050B-0300 Servo Motor R911309705
  • Bosch Rexroth KE312 Communication Module
  • Rexroth VCP05.2 IndraControl VCP 05 Panel
  • Rexroth CML40.2 IndraControl L PLC R911170254
  • Rexroth R911170826-206 Sercos Interface Module 24V DC
  • Mannesmann Rexroth VT 11030-12A 00010992 Valve Amplifier
  • Rexroth VT 11011-12 Amplifier Module R900010958
  • Bosch Rexroth SF-A1.0012.060-14.050 Servo Motor
  • Bosch Rexroth HCS01.1E-W0008-A-03-B R911325246 Inverter
  • Rexroth MDD093C-N-030-N2M-110PB2 Servo Motor
  • Bosch Rexroth MSK030B-0900-NN-M1-UG1-NNNN Servo Motor
  • Rexroth R900588201 4WE10E33/CG24N9K4 Solenoid Valve
  • Bosch Rexroth SR-A2.0020.030-00.000 Servo Motor 1070076772
  • Rexroth CML40.1-NP-220-NA-NNNN-NW Controller 1070170261-104
  • Yaskawa / Omron SGDM-01ADA - Sigma II Servo Drive 100W
  • Omron / KEP NT3S-ST123B-E - Interactive Display Operator Panel HMI
  • Yaskawa XD-01-MN01 - XtraDrive Servo Drive Controller