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

  • Basler XR2002F Voltage Regulator 9139400101
  • Basler 2D80367G23 DXCB De-Excitation Module 1200V 5000A
  • Basler SR4A-2B15B3A Static Regulator 120V 50/60Hz
  • Basler SSR 125-12NF Static Regulator 9 1859 00 106
  • Basler BE1-BPR Breaker Protection Relay 9272000315
  • Basler SSR 63-12 Static Regulator 9 1859 00 101
  • Basler AEM-2020 Analog Expansion Module
  • Basler BE 25231-001 Transformer BE25231001
  • Basler MVC 108 Manual Voltage Control 9037000102
  • Basler PSS-100-Y5 Power System Stabilizer 0.1-5.0Hz
  • Basler Electric BE1A-25-M1G-A6T-N4V1F Sync-Check Relay
  • Basler Electric SR8A2B10B1A Static Voltage Regulator
  • Basler Electric SR8A2B10B1A Static Voltage Regulator
  • Basler Electric SSR 125-12 Static Voltage Regulator 9185900102
  • Basler Electric 90-73900-102 Power Supply (Westinghouse 2374A07G03)
  • Basler Electric 9400200117 Control Power Unit 12/24VDC 20W
  • Basler Electric BE1-87G Solid State Generator Differential Relay
  • Basler Electric BE1-32R Style C3ED1TA0S1F Solid State Protective Relay
  • Basler Electric SR32A2B05B3E Static Voltage Regulator
  • Basler Electric SR8A2B06B3A Static Voltage Regulator
  • Basler MOC3502 90-72300-116 Motor Potentiometer
  • Basler SR4A2310B1A Static Voltage Regulator
  • Basler Electric 90-88800-102 PRS-250 Veri-Sync Relay
  • Basler Electric 90-88800-102 PRS-250 Veri-Sync Relay
  • Basler SR4A-2B05A3E Static Regulator SR4A2B05A3E
  • Basler 9-0723-00-130 9072300130 Control Module
  • Basler BE1-79MA10A6JC0L0F Reclosing Relay
  • Basler CBS-377 Current Boost System 91096001
  • Basler SR4A1B05A3A Static Regulator 480V 62.5V 10VA
  • Basler BE159N A7ED1JC0S0F Protective Relay BE159N-0
  • Basler BE3-25A Auto-Synchronizer S.No. 728
  • Basler BE1-50 Instantaneous Overcurrent Relay G4EA1RG0N0F
  • Basler Electric KT3B Voltage Regulator
  • Basler Electric ACA2500-14GCSYM GigE Camera
  • Basler Electric XR2002F Voltage Regulator
  • Basler Electric BE1-50 Instantaneous Overcurrent Relay F2EA1PA0N5F
  • Basler Electric CBS 212A Current Boost System
  • Basler Electric BE147NE3FE1PC3N3F Negative Sequence Voltage Relay
  • Basler Electric BE1-79MA10A6JC0L0F Automatic Reclosing Relay
  • Basler Electric BE1-59N A6E E1C B0N1F Neutral Overvoltage Relay
  • Basler Electric MVC 108 Manual Voltage Control
  • Basler Electric BE1-59-A4E-E1C-A0N0F Overvoltage Relay
  • Basler BE1-57/27R Solid State Protective Relay
  • Basler BE3-25AX Time Overcurrent Relay
  • BASLER ELECTRIC BE1-24/A1EF1JC1N0F / BE124A1EF1JC1N0F Overvoltage Relay
  • Basler Electric Solid State Protective Relay BE1-32R Style B2ED1PB0N0F
  • Basler BE3-51-3E1E1 9320000110 24VDC Overcurrent Relay
  • Basler UFOV 260A Underfrequency Overvoltage Module
  • Basler 50F4EA1PA0N0F Instantaneous Overcurrent Relay
  • Basler BE1-50 Instantaneous Overcurrent Relay
  • Basler BE1-32 Solid State Protective Relay
  • Basler SCP 250-G-60 VAR Power Factor Controller
  • Basler BE1-59N A5EE1KC0N0F Ground Fault Relay
  • Basler BE1-79A Reclosing Relay
  • Basler BE1-32R E1EA1OA0N0F Reverse Power Relay
  • Basler DCQA-103 DCQC104-1 CMX-7D Circuit Board
  • Basler SSR125-12 Static Regulator 918500102
  • Basler 90 17709 112 Regulator Control Board
  • Basler AVC63-4 AVC634 Voltage Regulator
  • Basler 9 1049 04 100 PC Board Control Module
  • Basler SR4A-2B03B3A Static Voltage Regulator
  • Basler SR8A-2B15B3A Static Voltage Regulator
  • Basler KR7FFX Static Regulator 840V
  • Basler EL200-7 Voltage Regulator 90-660VAC 7A
  • Basler PRP210-1 Reverse Power Relay 9056300102
  • Basler SSR 63-12 Static Regulator 600VAC
  • Basler 9289901106 Digital Board
  • Basler DECS100 Voltage Regulator DECS100A01
  • Basler Electric CEM-2020 Contact Expansion Module
  • Basler Electric BE3-25-1 C1 N4 Synchronizing Check Relay
  • Basler Electric ACA2000-50GM GigE Camera 2MP 50fps
  • Basler Electric ACA2240-20GMSYM GigE Camera Sony IMX264
  • Basler BE1-50G Ground Overcurrent Relay
  • Basler PRS250 Veri-Sync Relay
  • Basler MOC2199 Output Module
  • Basler UFOV 260A Underfrequency Overvoltage Module
  • Basler BE-15482-001 Control Module
  • Basler LSP4-7 Protective Relay
  • Basler SCP 250-G-60 VAR Power Factor Controller
  • Basler BE146N Negative Sequence Overcurrent Relay
  • Basler APR63-5 Automatic Voltage Regulator
  • Basler 9507900107 SR8A Retrofit Voltage Regulator
  • Basler BE1-320 Directional Power Relay
  • Basler KR7F Voltage Regulator 9116200100
  • Basler UFOV 260A Overvoltage Protective Module
  • Basler AEC63-7 Analog Excitation Controller
  • Basler 9992D90G01 Control Module
  • Basler 6966D22G01 Control Board
  • Basler 6965D40G01 Control Board
  • Basler BE1-50/51M-104 Overcurrent Relay
  • Basler BE1-BPR Programmable Breaker Relay
  • BASLER Electric SSR 125-9 1256 00 102 Static Voltage Regulator
  • Basler Electric MVC 112 Manual Voltage Control
  • Basler Electric 9321000102 Control Module
  • Basler Electric RA-70-MDCT7 Rectifier Assembly
  • Basler Electric ACA1300-60GM GigE Camera
  • Basler Electric 6427C85G01 Interface Board
  • Basler Electric 6965D05G01 Control Board
  • Basler Electric ACA2500-14UC Current Transducer
  • Basler Electric 9170206111 Protective Relay
  • Basler Electric BE1-11-G6D1M1J1P0E000 Protection Relay
  • Basler Electric BE1-50/51B-107 Overcurrent Relay
  • Basler 9121000106 Voltage Controller
  • Basler B3E-E1P-A0N0F Solid State Protective Relay
  • Basler 9121000106 Manual Voltage Control
  • Basler PRP320 Motor Pull-out Relay
  • Basler SSE-N 250-9KW Shunt Exciter Regulator
  • Basler BE1-50-51B-107 Overcurrent Relay
  • BASLER ELECTRIC MVC 108 MANUAL VOLTAGE CONTROL MODULE 9 0370 00 102
  • Basler BE1-59N-A7E-D1J-D0N0F Ground Overvoltage Relay
  • Basler BE1-46N-G1E-B8P-B0N0F Negative Sequence Overcurrent Relay
  • Basler BE1-951 Overcurrent Protection System
  • Basler Electric MOC2199 Motor Operated Potentiometer
  • Basler Electric BE1-60 Voltage Balance Solid State Relay B1FA1C1M1F
  • Basler Electric BE1-67N Directional Overcurrent Relay
  • Basler Electric PIA2400-17GM Interface Module
  • Basler Electric V6RAB Rectifier Module
  • Basler Electric BE1-32R Reverse Power Relay B2E E1R A0N1F
  • Basler Electric IFM-150 Firing Circuit Chassis 120V AC
  • Basler Electric IFM-102 Firing Circuit Chassis 120V AC
  • Basler Electric 9170206111 NSNP Control Module
  • Basler Electric SSR 63-12 Static Voltage Regulator
  • Basler UFOV 260A Overvoltage Protective Module
  • Basler SCA1300-32GM CCD Camera Lens Enclosure
  • Basler BA1-27 Under Voltage Relay
  • Basler 149D866G06 Control Board
  • Basler 9072300130 Power Supply Module
  • Basler CBS 305 Current Boost System