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

  • Metso Valmet BIU4 A413146 Binary Input Unit
  • Valmet AIU-8 Simulateur Board 421522-1a Analog Simulator
  • Valmet BIU8A Binary Input Unit 542803-3B M851222 M1
  • Valmet IQ Web Color DH Photoelectric Sensor A418182 2.04
  • Valmet A413200 AIU-8 Simulator Board 191151 421522-1A
  • Valmet Automation SCU M851006 System Control Unit Module
  • Valmet 857565/851565 Damatic Keyboard IP40 5V Operator Interface
  • Valmet A413077 FBC2 Module Rev 06 Field Bus Controller
  • Valmet DMU 2 PCB Module 545142-3A DM Data Management Unit
  • Valmet AIU16T PCB Card M851208 Analog Input Module
  • Valmet A413181 PLU Board
  • Valmet m851006 SCU Module
  • Valmet Metso 181226 Digital Input Module
  • Valmet AIU16T Analog Input Module - 16-Channel 65421466-2B MT924 V1.3
  • Valmet WIN3136875 Slide Clutch
  • Metso Valmet TIU61 A413111 Temperature Input Unit
  • Valmet MC12S Slitter Motor
  • Valmet A413139 AOH4 Board - Analog Output High Module
  • Valmet A409001 BIU85 Board
  • Valmet A413063 DMU Board
  • Valmet A413325 IPU I/O Power Unit
  • Valmet M851004 M2 CPU Module
  • Valmet IOP345 Digital Input Module
  • Metso Valmet A413215 Communication Board
  • Valmet DIFF-EL 80 M1 Transmitter
  • Valmet A413001 CPU Module
  • Valmet M899520 TDC-2 Module
  • Valmet A409001 BIU85 Board
  • Metso Valmet A413005 CPU Module
  • VALMET PUD 10 B Process Automation Rack with CPU SCU Module
  • Valmet A413091 GDU1 Board
  • VALMET M851006 M2 SCU Module
  • Lyngso Valmet Marine 990.896.000 Position Loop Card
  • Valmet Cooking Liquor Measurement 3417H
  • VALMET ABMB MT831 PCB Card
  • Valmet Automation A413325 IPU I/O Power Unit
  • Valmet Metso Consistency Transmitter Smart Pulp M2
  • VALMET METSO A413274 Connection Module
  • VALMET PI33S1KSA02RSA-ELI26 Switch
  • VALMET ND9103HN-CE07-K05 Intelligent Valve Controller
  • VALMET PMB 2R 16 Slot Backplane PCB Card
  • NELES VALMET A413135 AOU 4 Output Module
  • Metso Valmet A413345 FPU Power Unit
  • VALMET A413171 PIC Module
  • VALMET A413620 Repeater Module
  • Valmet M851521 Memory Card
  • Valmet DIFF-EL 140 M1 Transmitter
  • Valmet A413064 DMU Module
  • Valmet IOP371 I/O Bus Extender Module
  • Valmet Cooking Liquor Measurement 3400 Model 3417H
  • Metso Valmet A413043 CPU Module – Industrial Processor
  • Valmet BIU4 M851221 Binary Input Module
  • Valmet PMB 1S CPU SCU Rack Module
  • Valmet A413248 Controller Module
  • Valmet PDP601 Distributed Processing Unit
  • VALMET M851004 M2 CPU Printed Circuit Board Module
  • Metso Valmet A413045 Ver.05 CPU Module
  • Valmet A413181 Ver.05 PLU1 Board
  • Lyngso Valmet ATB16 Controller Board
  • VALMET AIU 16 Analog Input Unit 545100-3A/3B
  • VALMET PUD 10 B Power Supply PCB Rack Module
  • Valmet MS-50V/120V Bearing Unit
  • Valmet PDP603 Distributed Processing Unit – DPU Module
  • Valmet A413110 TIU Board – Terminal Interface Unit
  • Valmet S420154 I/O Backplane PCB – Printed Circuit Board
  • Valmet A413173 Industrial Control Module
  • Valmet A413044 CPU Module
  • Valmet A4IU1 Analog I/O Module
  • Valmet A413325 IPU Power Unit – PLC Module
  • Valmet M851002 CPU Module – Central Processing Unit
  • Valmet PUD10B Power Supply Board
  • Valmet K00990 Master CPU Electronic Assy
  • Valmet Metso IOP345 Input Module
  • Metso Automation T545215 Board
  • Valmet Metso IOP304 Input Module
  • Valmet 542844-6A SCU Module
  • Metso A413043 Ver.11 Valmet CPU Module
  • Valmet Automation BIU 8A Input Module
  • Metso A413044 Ver05 Valmet CPU Module
  • VALMET 542821-5A Control System Rack Module
  • Metso A413005 Ver.04 Valmet CPU Module
  • Valmet M851207 AIU16 Card
  • Valmet BIU8 Binary Input Unit
  • VALMET 547070-2B CPU Printed Circuit Board Module
  • Valmet Automation A413325 Power Module
  • VALMET AUTOMATION A413135 AOU4 Module
  • VALMET ACU A413165 Model 9 Analog Controller
  • VALMET AUTOMATION A413511-02 Slot Rack with I/O Backplane
  • Valmet A413148 BIE 4 Rev 08 Board
  • Valmet ATB16-4 Controller Board
  • Neles Automation BOR82 A413292 Processor Module
  • Valmet A413015 NCU Module – Network Control Unit
  • Valmet AIU 16 Analog Input Unit – M8512071
  • Metso Valmet A413091 GDU Board
  • Valmet M851565 Damatic Main Keyboard
  • Metso A413082 CPU Module
  • Valmet A403037 GDC – Graphics Display Controller
  • Valmet A413076 FBC Board
  • Valmet A413015 NCU Module – Network Control Unit
  • Valmet A413082 CPU Module
  • VALMET AUTOMATION A413620 Fieldbus Repeater
  • Valmet Metso IOP341R Positioner Module
  • Metso A413082 Ver.04 CPU Module
  • Valmet Metso MCA FT250/10 10 Inch Sensor
  • Valmet N0542 ABMB Printed Circuit Board
  • Valmet A413000 Ver.07 CPU Module
  • Valmet A413061 Ver.05 DMU Module
  • Valmet M851241 M1 BCU Binary Input Module
  • Valmet Automation NCU A413015 Circuit Board
  • Valmet A413046 Ver.06 CPU Module
  • Valmet A651B001 Panel Mount Keyboard
  • Valmet IQ Scanner A418080R Basis Weight Detector Head
  • Metso Valmet A413370 ESU Ethernet SCSI Unit
  • Valmet A413340 FPU Power Supply Unit
  • Valmet SKF GE 400/600 Spherical Plain Bearing
  • Valmet SCU PCB Card 542844-7B – System Control Unit
  • Valmet A413075 FBU Fieldbus Controller Module
  • Valmet A413171 PIC Card Binary Output
  • Valmet A413002 Ver.05 CPU
  • Valmet ABMB PCB Card – Industrial Control Board
  • Valmet PMB 2R 542821-4A PCB Card
  • Metso Valmet A413001 CPU Module
  • Metso Valmet A413050 RSU 6 Serial Controller Unit
  • Valmet ABMB MT241 Input Mother Board
  • Valmet DAMATIC M851565 Keyboard
  • Valmet A413075 Ver05 FBC Board
  • VALMET K14891 FLEXI-U Operating Terminal
  • VALMET AUTOMATION MKB2 DAMATIC Keyboard