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

  • Mannesmann Rexroth VT3006-36 Analog Amplifier Card
  • Bosch Rexroth R900086160 PGF1 Gear Pump
  • Bosch Rexroth R911173263 VDP15.3 Touch Display
  • Bosch Rexroth PPC-R22.1 RJ522 Industrial Controller
  • Bosch Rexroth MSK060C-0300-NN-S1-UG0-NNNN Servo Motor
  • Bosch Rexroth R911325068 NYS04.1 Controller
  • Bosch Rexroth R911335439 CSH01.1C Control Unit
  • Bosch Rexroth R917010287 BODAS RC10 Controller
  • Bosch Rexroth R911329791 CSH01.1C Drive Controller
  • Bosch Rexroth R182432310 Runner Block Guide
  • Bosch Rexroth VT-VSPA2-1-11 Amplifier Card R900021909
  • Bosch Rexroth MKD090B-047-KG1-KN Servo Motor
  • Bosch Rexroth LTU350 Servo Amplifier 0608750108
  • Bosch Rexroth 5610102050 Pneumatic Vacuum Regulator
  • Bosch Rexroth VT5041-23/3-OV PLC Control Board
  • Bosch Rexroth VT3015 S10/E Servo Amplifier Board
  • Bosch Rexroth MSK070D-0300-NN-M2-UG1 Servo Motor
  • Bosch Rexroth 3DREP6C-21 Valve R900955887
  • Bosch Rexroth R151244013 Ball Screw Bearing Unit
  • Bosch Rexroth MSM031C-0300 Servomotor R911325140
  • Bosch Rexroth EMD-B16.1-DC024N Box R911291681
  • Bosch Rexroth MKD071B-061-GP0-KN Servo Motor
  • Bosch Rexroth MSK030C-0900-NN-M1-UG1 Servo Motor
  • Bosch Rexroth EcoDrive DKC01.3-004-3-MGP-01 Servo Controller (299772)
  • Bosch Rexroth DKC02.3-040-7 EcoDrive Controller
  • Bosch Rexroth CLC-D02.3 CLC Motion Control Board
  • Bosch Rexroth HDS05.2-W300N Drive R911190019
  • Bosch Rexroth DKCXX.3-100-7 Servo Drive Unit
  • Bosch Rexroth CSE02.1A-S3-EC Control Unit R911339030
  • Bosch Rexroth MSK040C-0600-NN-S1-UP0 Servo Motor
  • Bosch Rexroth VT3013 S36 R5 Circuit Board Card
  • Bosch Rexroth VT3000-36A Amplifier Card R90020298
  • Bosch Rexroth VPB40.3 IndraControl Module R911374113
  • Bosch Rexroth HCS02.1E-W0054-A-03-NNNN Converter with R911332574 Control Unit
  • Bosch Rexroth MHD071B-061-PG1-UN Servo Motor
  • Bosch Rexroth A2F5/60W-B3-S Piston Motor R909418904
  • Bosch Rexroth HCS01.1E-W0018-A-03-B-ET-EC-NN-NN-NN-FW IndraDrive Cs Converter
  • Bosch Rexroth 4WRPEH 6 C4B40P-2X/G24K0/A1M Proportional Directional Valve (0 811 404 647)
  • Bosch Rexroth R911405975 ctrlX OS PLC Controller
  • Bosch Rexroth CSB02.1B-ET-EC-NN-S4-NN-NN-FW Servo Control Card R911338543
  • Rexroth MSK050B-0300-NN-M1-UG0-NNN Servo Motor
  • Rexroth IndraControl VEPXX.5-ATOM Set R911374889 Panel
  • Rexroth 1070089906-GC1 1070089907-201 Board
  • Rexroth CSB01.1C-SE-ENS-EN2-NN-S-NN-FW Control Unit
  • Rexroth MKD071B-024-KG3-KN Servo Motor
  • Rexroth Indramat DKC02.3-040-7-FW Controller
  • Rexroth HCS02.1E-W0028-A-03-NNNN Servo Module
  • Rexroth HMD01.1N-W0036-A-07-NNNN Drive Module
  • Rexroth MSK050C-0600-NN-M1-UG0-NNN Servo Motor
  • Rexroth DKC02.3-040-7-FW Servo Controller
  • Bosch Rexroth VT-5014S30-R1 Amplifier Card
  • Bosch Rexroth MSK040C-0600-NN-M1-UG1 Servo Motor
  • Bosch Rexroth MKD071B-061-GG0-KN Servo Motor
  • Bosch Rexroth VT5012-S45-R1 Amplifier Card
  • Bosch Rexroth SHL03.1-NNN-S-NNN Encoder Module
  • Bosch Rexroth EFC3600-0K75 Frequency Converter
  • Bosch Rexroth VFC3610-1K50-3P4-MNA-7P-NNNNN-NNNN 1.5kW Frequency Inverter
  • Bosch Rexroth EFC5610-2K20-3P4-MDA-7P-NNNNN-L1NN 2.2kW Frequency Converter
  • Bosch Rexroth XM21 XM2100.01 PLC Control Unit
  • Rexroth CSH01.1C-ET-ENS R911328178 HMS01.1N-W0020 Drive Package
  • April AXI0010 - Single Axis Servo Controller
  • Rexroth DKC10.3-004-3-MGP-01VRS Servo Drive
  • Bosch DKC02.3-040-7-FW Servo Drive
  • Rexroth DKC06.3-040-7-FW Servo Drive Controller
  • Rexroth VPB40.3 SE T R911374113 Control Module
  • Rexroth S20-SSI-AO-1/1 R911172544-AB1 Module
  • Rexroth R911173004 AC1 GH1 PLC Control Set
  • Rexroth VPB40.3D1L-1G0NN-D1D-DN-NN-FW Module
  • Rexroth MDD071B-N-040-N2T-095GB1 Servo Motor
  • Bosch Rexroth DM15K1101-D Servo Drive Module
  • Rexroth CSH01.3C-PB-ENS-MA1-CCD-S2-S-NN-FW Drive
  • Rexroth HMS01.1N-W0036 CSB02.1B Drive Package
  • Rexroth MSK070E-0300-NN-M2-UG0-RNN Servo Motor
  • Rexroth AZPF-1X-004RCB20KB Gear Pump
  • Rexroth NFD03.1-480-055 Powerline Filter
  • Rexroth VT-VARAP1-537-20/V0 Valve Amplifier
  • Rexroth HVE04.2-W075N Supply Module
  • Rexroth HMD01.1N-W0020-A-07-NNNN Drive Controller
  • Rexroth VDP40.3DIN-D1-NN-CG HMI Computer
  • Rexroth HDS05.2-W300N-HS12-01FW Drive Module
  • Rexroth HMS01.1N-W0070-A-07-NNNN Power Section
  • Rexroth Indramat MKD071B-061-GP0-KN Servo Motor
  • Rexroth HDS03.2-W075N-HS12-01-FW Control Unit
  • Rexroth HCS02.1E-W0054-A-03-NNNN Servo Drive
  • Rexroth CML40.2-SP-330-NA-NNNN-NW IndraControl
  • Rexroth CSH01.1C-PB-ENS-NNN-MA1-S2-S-NN-FW Drive
  • Rexroth PPC-R22.1 DAQ03 Servo Drive
  • Rexroth HCS02.1E-W0070-A-03-NNNN Servo Drive
  • Rexroth RF-FLS PB M12 DIO 8/8 M12 Module
  • Rexroth Indramat TBM 1.2-40-W1-024 Servo Bleeder
  • Rexroth Indramat MKD071B-061-KG1-KN Servo Motor
  • Rexroth CML40.2-SP-330-NA-NNNN-NW IndraControl L40
  • Rexroth VCP08.2DTN-003-NN-NN-PW Operator Panel
  • Bosch Rexroth DM30K1101-D Servo Drive 670V DC
  • Rexroth PPC-R22.1N-N-Q1-NN-NN-FW Motion Controller
  • Rexroth MSK040C-0600-NN-M1-UG1-NNNN Servo Motor
  • Rexroth CSH01.1C-S3-ENS-NNN-NNN-S2-S-NN-FW Drive Controller
  • Rexroth PPC-R22.1 Motion Control Module 004566384
  • Rexroth CSH01.1C-PB-ENS-NNN-MA1-S2-S-NN-FW Controller
  • Rexroth CML25.1-3N-400-NN-NNC1-NW IndraControl L25
  • Rexroth MSK030C-0900-NN-M1-UP1-NSNN Servo Motor
  • Rexroth HCS02.1E-W0028-A-03 CSH01.1C-PB Drive Package
  • Bosch Rexroth VT-VARAP 1-537-20/V0 Amplifier
  • Bosch Rexroth PPC-R02.2N R911285402 Control Unit
  • National Instruments PCI-7342 Motion Controller
  • National Instruments PXIe-6535 Digital I/O Module
  • National Instruments PCIe-6738 Analog Output Card
  • National Instruments NI-6583 Digital I/O Adapter Module
  • National Instruments NI TB-9214 Terminal Block
  • National Instruments NI 9222 Simultaneous Analog Input Module
  • National Instruments PXIe-8364 MXI-Express Module
  • National Instruments PXI-8185 Embedded Controller
  • National Instruments PCI-1405 Device
  • National Instruments SCXI-1160 Module
  • National Instruments PCI-MIO-16E-1 Device
  • National Instruments USB-6216 Device
  • National Instruments PXIe-2543 Module
  • National Instruments PCI-5102 Digitizer
  • National Instruments PXI-6284 DAQ Device
  • National Instruments PXI-7330 Controller
  • National Instruments cFP-2100 Controller
  • National Instruments USB-6002 DAQ Device
  • National Instruments PCIe-6374 Multifunction DAQ Card
  • National Instruments PXIe-4610 Power Amplifier Module
  • National Instruments PXIe-4154 Battery Simulator
  • National Instruments PXIe-7858R Reconfigurable I/O Module
  • National Instruments BNC-2090A BNC Terminal Block
  • National Instruments cRIO-9066 CompactRIO Controller