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

  • ABB SACO 64D4 Digital Annunciator Unit 64-Channel Alarm System
  • EMERSON FloBoss S600+ P154 PRV Board 7381540 Prover Module
  • EMERSON FloBoss S600+ P155 PSU Board 7161550 Power Supply
  • EMERSON FloBoss S600+ P153 Front Panel 7181530 Display Keypad
  • EMERSON FloBoss S600+ P148 Dual Pulse Mezzanine 7181483 Module
  • EMERSON FloBoss S600+ P144 I/O Board 7281440 Analog Digital Module
  • EMERSON FloBoss S600+ P152 CPU Board 7381520 Main Processor
  • EMERSON FloBoss S600+ Base Unit 8176003 Flow Computer Chassis
  • Lauer PCS100FZ XX1.1031.SHX PLC HMI Operator Panel
  • Lauer Weber PCS095.S PG 195.203.3 Operator Panel HMI
  • Lauer Pcs Light PG 080.308.E Operator Panel HMI Console
  • Lauer Pcs Light PG 080.308.E Operator Panel HMI
  • Lauer PCS590p Pg 59X.000.0 PROFIBUS-DP HMI Panel
  • Lauer PCS095.1 095.408.A Operator Panel HMI
  • Lauer PCS009.m 109.203.1 Operator Panel PCS009
  • Lauer Pcs Light PG 080.308.F PLC HMI Operator Panel
  • Lauer Pcs 095.s 195.203.3 Operator Panel – Industrial HMI
  • Lauer LCA 200 (200-V02093) Starline Mini Operator Terminal – Compact HMI
  • Lauer PCS 110FZ Operating Screen – Compact Industrial Display
  • Lauer LCA200 022/581 Operator Terminal – Industrial HMI Panel
  • Lauer AST-150A Front Cover with Touch – Replacement Bezel for Industrial Panels
  • Lauer PCS8010 035/28B Operator Panel – Industrial HMI
  • Lauer PCS260FZ Membrane Keyboard Replacement
  • Lauer PCS plus MPI PCS090.m Operator Console
  • Lauer PCS 806 EEPROM Memory Module
  • Lauer VPC S95e 410 Control Panel System Controller
  • Lauer PG095.507.A Operator Panel PCS095 HMI
  • Lauer PCS8010 035/28B Operator Panel HMI Console
  • Lauer Pcs 810 Interface Module – 01676-B8 Communication Unit
  • Lauer PCS950 Keyboard – Replacement Keypad for Operator Panels
  • Lauer LCA200-V00880 Operator Terminal – Industrial HMI Panel
  • Lauer Pz 095 Operator Panel – PG095.507.A Branson Label HMI
  • Lauer PCS095 Operator Panel – PG095.408.A Industrial HMI
  • Lauer PCS095 Display Control Unit – PG095.508.B Industrial HMI
  • Lauer PCS009.S Membrane Keyboard – Replacement Keypad for Operator Panels
  • Lauer LHT-T100t-Ne Control Panel – V16-10-10 Industrial HMI
  • Rohwedder PQ1206 Control Panel – PCS095 PG 095.508.A HMI
  • Lauer 19557-D4 Text Display – Industrial Alphanumeric Terminal
  • Lauer PCS950 Control Panel PG950.103.0
  • Lauer VPC Monitor 112TE Industrial Display
  • Lauer PCS 609 Topline Micro Operator Panel
  • Lauer PCS110FZ PG1001 Operator Panel Control Console
  • KBA BAB50312 Operating Terminal – RGF 518297 Press Control Panel
  • Lauer 4x40 Alphanumeric Display – Industrial Text Terminal
  • Lauer PCS830-3 Operator Panel – Industrial HMI Terminal
  • Lauer PCS900 (900.202.6 / 060695) Operator Panel – Metronic Series Industrial HMI
  • Lauer PG095.507.A Operator Panel – Compact Industrial HMI
  • Lauer LCA 265 Text Display – Alphanumeric Control Unit
  • Lauer VPC S95e 410 V101.C Control Unit – VPC System Controller
  • Lauer PCS 200 Control Console – PG 200.011.4 Operator Panel
  • Lauer PCS 8010 Operator Panel – Industrial HMI Terminal
  • Lauer 047/00 Power Supply Module – Industrial DC Unit
  • Lauer PCS600FZ Operator Panel PCS Systems Control Console
  • Lauer LCA 265 Text Display Control Unit
  • Lauer WOP-iT X550tm 06539 Operator Panel HMI
  • Lauer AST-150A Cover with Touch 4PIN 251X322mm
  • Lauer 035/18F Systeme Lauer Operator Panel Display
  • Lauer LCA200 022/581 Text Display Console
  • Lauer PCS8110 035/38A Operator Panel HMI Console
  • Lauer 035/18F LS Systems Operator Panel HMI Display
  • Lauer MT212 USB Control Panel 24V DC 1A 15VA
  • Lauer PCS 810 System Communication Module – Industrial Network Interface
  • Lauer Pz 095 Operator Panel – PG 095.508.A Industrial HMI
  • Lauer 06134 Embedded Industrial PC – Compact Fanless Computer
  • Lauer EPC640TC Front Cover – Replacement Bezel for Industrial Panel
  • Lauer PCS 600 Euroterminal Control Panel – 00480-B3 Compact HMI
  • Lauer LCA 180 Text Monitor – Compact Alphanumeric Display for Industrial Control
  • Lauer VK212B.5.0.1.0.LAU VPC Control Panel – Industrial HMI
  • Lauer PCs090 Topline Control Panel – PG090.205.B Operator Interface
  • Lauer PCs 811 Interbus S Module – PG 811.000.3 Fieldbus Interface
  • BACHMANN IPC1410 Membrane Keypad – Replacement Switch Keyboard
  • Lauer LCA 640.1 Operator Terminal – Compact Text/Graphic Display
  • Lauer PCS 8010 Operator Panel – Versatile Industrial Terminal
  • Lauer AIO 110 C6FBXP openAutomation – All-in-One Industrial Controller
  • Lauer PCS009.S Membrane Keyboard – Replacement Keypad for Operator Panels
  • Lauer 035/18F LS Systems Power Supply – Industrial DC Module
  • Lauer PCS095.5 PCS095.417.A Operator Panel
  • Lauer WOP IT X 550KTC Mobile Panel – Wireless Operator Terminal
  • Lauer PCS 810 E Interface Assembly – 2W/6ES5 491 0LB11
  • Lauer P090b/L033/02a Interface Module – Compact I/O and Power Unit
  • Lauer LP035/18 Power Supply Module – Industrial DC Power Unit
  • Lauer PCs 090 Topline Control Console – 090.205.B Operator Panel
  • Lauer VT215e.II.NTR VPC Control Panel – Take Off Line HMI
  • Lauer P090b/L033/03 Interface Module – Power and I/O Unit
  • Lauer EPC X 550 TC Panel PC – Industrial Touch Computer
  • Lauer Mt212.Lau Industrial Monitor – 24V DC 15VA Display
  • Lauer PCS 810 Communication Module – System Communication Unit
  • Lauer PCS811 Interbus-S Interface Module – Version 811.000.3
  • Lauer PCS810-1 Interface Module – PCS810-100186-C5
  • Lauer TP21AM/731030 Teach Pendant – Handheld Operator Terminal
  • Lauer LP035/18 Power Supply Module – Industrial DC Power Unit
  • Lauer LCA 200.202.2 Mini Control Unit Display
  • Pulsotronic 8450-00 Power Supply for Lauer Systems
  • Lauer Starline Midi LCA300.0 Text Display Console
  • Lauer PCS9000 035/27C Operator Panel HMI Display Unit
  • Lauer PCS900 PG900.202.6 Operator Panel Control Console
  • Lauer PCS090 PG090.000.4 Operator Panel Control Console
  • Lauer LCA265 Text Display Industrial Information Console
  • Lauer PCS 200FZ Control Panel Industrial Operator Console
  • Lauer PCS810-3 Interface Module Communication Board
  • Lauer PCS009 009.204.2 Operator Panel HMI Control Console
  • Lauer A-110-C6FBXP Industrial Display Monitor
  • Lauer VPCM 310 Key Control Panel Industrial Keyboard Interface
  • Lauer PCS830.0 Operator Panel – Mid-Range HMI for Versatile Applications
  • Lauer PCS950 PG 950.100.6 Operator Panel – High-End HMI for Complex Systems
  • Lauer LCA041 Text Display – Compact Alphanumeric Terminal
  • Lauer VT215B.II VPC Control Panel – Compact Versatile HMI
  • Lauer LCA 245 Text View 245.100.1 – Alphanumeric Display for Simple Control
  • Lauer PCS600FZ Operator Panel – Enhanced HMI with Extended Features
  • Lauer PCS600 PX 600.002.1 Operator Panel – Compact HMI with High Performance
  • Lauer VPC VK212b.II.LAU Control Panel – Robust HMI for Heavy Industry
  • Lauer PCS 810-1 Operator Terminal – Advanced HMI for Mid-Size Systems
  • Lauer 07182-F5 Control Panel LCA 245 – Industrial HMI for Complex Automation
  • Lauer PSC830-31 Interface Module Industrial Communication Board
  • Lauer PCS806.0 Interface Module Industrial Automation Component
  • Lauer LCA 200.102.1 Text Display LCA Starline Mini Console
  • Lauer Panel VPCT MT215L Industrial Touch Panel Display
  • Lauer Suetron Panel TP21AM/731030 Teach Pendant Industrial Touch Panel
  • Lauer PG090.000.4 120592 Control Panel PCS090 Topline Operator Panel
  • Lauer PCS 830 Interface Module Industrial Communication Board
  • Lauer PCS830-1 Interface Module TTY Communication Board
  • Lauer PCS9000 035/27C Operator Panel HMI Display Unit
  • Lauer EPC-PM-1500tc Industrial PC Embedded Computer Specifications
  • Lauer PCS804.1 Operator Terminal – Compact Industrial HMI
  • Lauer VPC VK212b.II.LAU Control Panel – Rugged Operator Interface
  • Lauer PCS090 PG090.208.E Topline Mini – Compact HMI Panel
  • Lauer PCS090 PG090.205.B Topline Operator Panel – High Performance HMI
  • Lauer P090b/L033/00a Interface Module – Reliable Automation I/O