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

  • 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
  • Lauer P090b/L033/01 Interface Module – Compact Automation Component
  • Lauer LCA 180 Textmonitor – Compact Text Display for Industrial Control
  • Lauer 200-V02366 System Panel – Advanced Industrial Display Unit
  • Lauer LCA 200 Operator Panel – Industrial HMI Touch Screen
  • LAUER PCS 095 PG095.508.C Operator Panel | Compact HMI
  • Systeme Lauer PCS100 Operator Console | Durable HMI Terminal
  • Lauer P090b/L033/00 Industrial Module | Replacement Part
  • LAUER PCS-220FZ Operator Panel | Advanced Control Interface
  • Lauer EPC-PM03032 Control Terminal | Power Interface Panel
  • Lauer GENE-4312 Industrial Motherboard | Embedded Computing
  • Lauer EPC X 550 Controller | Advanced Automation CPU
  • Lauer EPC-PM-1200tr Industrial PC Panel | Rugged Touch Display
  • Lauer AIOvision AVTCE210.2 MPI Vision System Controller
  • Lauer LCA 200 V03907 Control Console Operator Interface
  • Lauer PCS 095 PG095.507.A Operator Panel Industrial HMI
  • Lauer 035/24 Industrial Control Module Automation Component
  • Systeme Lauer PCS830-31 Interface Module Industrial Automation
  • Lauer PCS090.M 190.203.3 Operator Panel Industrial Control
  • Systems Lauer LCA045 Text Display Operator Terminal
  • Lauer EPC-PM-1200TC Industrial PC Panel
  • Lauer PCS095 Topline Mini Operator Panel 095.506.8
  • Lauer PCS 8010 Expansion Module
  • Lauer PCS950Q PLUS Membrane Keypad
  • Lauer Tele Service TSN 110 Module
  • Lauer PCS950C User Interface Trepko 95C.201.0
  • Lauer PCS 200FZ Control Console XX2.1031.SHX
  • Lauer PCS950 Operator Panel Wifag 950.000.5
  • Lauer PCS 950 Topline Midi Control Panel 950.000.05
  • Lauer LHT-T40m-P Control Panel V15-10-10
  • Lauer Operator Panel PCS Light PG080.308.F
  • Lauer LCA Starline Mini 200.102.1
  • Lauer VPC Take Off Line VK212B.II.LAU
  • Lauer Grießbach Printing Machine Operating Terminal BAB34098
  • BS Lauer LP 056/02 Operator Panel
  • Lauer AVTCE212.3 HMI Panel
  • Lauer PCS950 Operator Panel 950.000.5 Wifag
  • Lauer PCS095 Topline Mini 095.508.B Operator Panel
  • Lauer PCS 811 Interbus-S Module Fieldbus Communication Interface
  • Systeme Lauer 035/18F Industrial Control Module Automation
  • LAUER PCS090 090.202.7 Operator Panel Industrial Control
  • Lauer PCS 600 Control Console Industrial Operator Panel
  • Lauer PCS095 Topline PG095.505.8 Operator Panel HMI
  • Systeme Lauer PCS830-3 Control Module Industrial Automation
  • Lauer EPC-PM-1200TR Industrial PC Panel Touch Display Computer
  • Lauer PCS090 PG090.208.E Operator Panel Industrial Terminal
  • Lauer PCS 804 Interbus Interface Module Fieldbus Adapter
  • Lauer PCS 802 Control Console Industrial Operator Panel
  • Lauer Operator Panel PCS950 with PCS808
  • Lauer PCS950Q Topline Midi 950.000.5
  • Lauer LCA 320 300.001.0 Text Display
  • Lauer Operator Panel PCS090 PG090.207.D
  • Lauer PCS PCS095.1 Operator Panel Skinetta
  • Lauer PCS8010 035/28B Expansion Module
  • Lauer Topline Mini Operator Panel PCS 090 PG090.208.E
  • Systeme Lauer PCS830-1 Interface Board 830.1-00124-H6
  • Kuttler Lauer PCS090.M PG190.203.3 Operator Panel
  • Lauer PCS 090 Control Console Operator Terminal Industrial
  • Lauer PCS 804.1 Interbus Adapter Module Fieldbus Interface
  • Lauer LCA 300.0 Starline Midi Text Display Control Panel
  • Systems Lauer PCS811 GEB Interbus-S Slave Module Fieldbus
  • Lauer PCS 811 Interbus-S Module PG 811.000.1 Fieldbus Interface
  • LAUER WOP-IT-X-550-KTC Industrial Touch Panel HMI Terminal
  • Lauer PCS609 Topline Micro Panel Operator Interface Industrial
  • Lauer PCS 090 Topline Mini PG 090.207.D Operator Panel Industrial HMI
  • Lauer AIO Automation in One PC Unit 24V DC
  • Lauer WOP-IT-X-640TC UMP
  • Systeme Lauer LCA 265 Text Display 24V
  • Lauer VPC Take Off Line MT215.LAU
  • Systeme Lauer SIMATIC S5 Serial Interface Board PCS 810-1
  • Lauer PCS WIN Profibus DP PCS 090b/L033/03
  • Lauer LCA200 Starline Mini