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 | 1114 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 Electric DECS-250-CN1SN1N Digital Excitation Control System
  • Basler Electric BE1-700 E0N2X1N Digital Protective Relay
  • Basler Electric SR4A-2B15B3A Static Voltage Regulator 120VAC 50/60Hz
  • Basler Electric 9261402111 PCB Control Board 9346000033
  • Basler Electric BE28053-002 Transformer BE28053002
  • Basler Electric BE3-25A Auto Synchronizer B1D Sync Module
  • Basler Electric BE3-GPR Generator Protective Relay
  • Basler Electric SCP-250-G-60 VAR Power Factor Controller 9 1100 00 109
  • Basler Electric BE3-32-1S1N1 Reverse Power Relay 277V 5A
  • Basler Electric ACA1300-60GM Area Scan Camera 106200-17
  • Basler Electric UFOV 260 A Protection Module Specs
  • Basler Electric BE03303001 Control Module
  • Basler Electric BE3-GPR-P1BVSF Generator Protective Relay
  • Basler Electric BE1-87G Solid State Protective Relay Guide
  • BASLER ELECTRIC BE1-60 VOLTAGE BALANCE RELAY T176884
  • Basler Electric BE1-32R Protective Relay
  • Basler Electric 9022900-103 Transformer 6-7VA 60Hz
  • Basler Electric BE1-59-A4E-E1K-B1S3F Overvoltage Relay
  • Basler Electric KR2FF-M Voltage Regulator 9 1163 00 103
  • Basler Electric UFOV 260 A Protective Module
  • Basler Electric PCB Assembly 9059701100 919620
  • Basler Electric SR8A2B01A3E Static Voltage Regulator
  • Basler Electric SSR125-12 Static Voltage Regulator 9185900102
  • Basler Electric SSR 63-12 Static Voltage Regulator 600VAC
  • Basler Electric BE1-60 Solid State Protective Relay
  • Basler Electric BE3-47N/27-3A4N2 Voltage Relay 9320400101
  • Basler Electric BE1-59 Over Voltage Relay
  • Basler Electric DECS100-B15 Automatic Voltage Regulator
  • Basler Electric PRS250 Veri-Sync Relay 9088800102
  • Basler Electric BE25927001 Current Transformer 1:34 Amp
  • Basler Electric 9170818100 Generator Differential Relay
  • Basler Electric BE1-59N Solid State Ground Fault Overvoltage Relay
  • Basler Electric 1783 DC Current Transformer Coil 1200:5A
  • Basler Electric BE1-67 Ground Directional Overcurrent Relay
  • Basler Electric UFOV-260A Underfrequency Overvoltage Module
  • Basler Electric BE10493001 Control Module
  • Basler Electric SSR125-12 Static Voltage Regulator Guide
  • Basler Electric BE1810/U-2 Solid State Frequency Relay Guide
  • Basler Electric 9105100106 UFOV-250A Protector Guide
  • Basler Electric MOC2199 9072300-335 Relay Module Guide
  • Basler Electric 9289902106 Circuit Board
  • Basler Electric BE1-32R Protective Relay A1E E1P BOS1P
  • Basler Electric RAL6144-16GM GigE Line Scan Camera with Lens
  • Basler Electric BE3-49R-5I5A1 Temperature Relay
  • Basler Electric BE1-32R Power Relay B3E E1R A0N1F
  • Basler Electric SR4A2B06B3A Static Voltage Regulator Features
  • Basler Electric 9121000106 Manual Voltage Control MVC Guide
  • Basler Electric SR32A-2B15B3E Static Voltage Regulator
  • Basler Electric SR4A2B06B3A Static Voltage Regulator Guide
  • Basler Electric 801A193F02 Hammond Transformer Module
  • Basler Electric BE1-24 Volts Per Hertz Relay A1E F1J D1S0F
  • Basler Electric AEC63-7 Analog Excitation Controller 220-277V
  • Basler Electric BE132R Power Relay T245579
  • Basler Electric MVC 108 Manual Voltage Control 90 37000 102
  • Basler Electric 9022900-103 Control Transformer 6-7VA 60Hz
  • Basler Electric BE1-79M Plug Adapter 9170111102
  • Basler Electric 9 2007 00 100 Current Boost System CBS 305
  • Basler Electric SR4A2B01B3A Static Voltage Regulator 120V
  • Basler Electric BE1-32R Power Solid State Relay E2E A10 A0N0F
  • Basler Electric PRS250 Veri-Sync Relay 9088800102
  • Basler DECS 125-15-B2C Digital Excitation Control
  • Basler BE 13693 002 Transformer
  • Basler BE1-59N Ground Fault Overvoltage Relay
  • Basler BE1-79A Reclosing Relay
  • Basler 9-1051-00-105 Overload Protection Module
  • Basler BE1-32R Power Relay – Directional Overcurrent Guide
  • Basler 9319700103 BE3-27T/59T-3A1N3 Voltage Relay
  • Basler BE1-87G Generator Differential Relay
  • Basler BE3-25-1D1N4 9319100106 480V Relay
  • Basler SR8A2B07B3A Static Voltage Regulator
  • Basler Electric BE4-27/59 Over/Under Voltage Relay 307-2552
  • Basler Electric SR32A2B05B3E Static Voltage Regulator
  • Basler Electric BE1-27 A3E C3J A1N6F Solid State Protective Relay
  • Basler Electric 9174700-100 Excitation Limiter Generator
  • Basler Electric BE1-87G Generator Differential Relay 09833
  • Basler Electric 9310200100 Power Supply Module
  • Basler Electric TIEE1CD0N07 Control Module
  • Basler Electric BE1-59N Ground Fault Relay T214750
  • Basler Electric SR8A2B10B3AX Static Voltage Regulator 9060200126
  • Basler Electric SSR 125-12 Voltage Regulator
  • Rolls Royce H1111.0204 Ship Main Controller
  • Basler Electric BE3-32-3AC Reverse Power Relay 9 1376 00 105
  • Basler Electric BE3-25-1A1N4 Synch Check Relay 9319100100
  • Basler Electric SR4A-2B15B3A Static Voltage Regulator
  • Basler Electric SR4A-2B15B3E Static Voltage Regulator
  • Basler Electric 9170818100 Solid State Protective Relay
  • Basler Electric AEC63-7 Analog Excitation Controller
  • Basler Electric 17483 Auxiliary Module
  • Basler Electric BE1-59 Over Voltage Relay
  • Basler Electric 21600-101 Control Module
  • Basler Electric KR2F Generator Voltage Regulator 9056600100
  • Basler BE1-CDS Current Differential System
  • Basler Electric CBS 212 Current Boost System 9 2650 00 100
  • Basler Electric IFM-150 Firing Circuit Chassis
  • Basler Electric BE1-60 Voltage Balance Relay C1F A1P D0C3F
  • Basler Electric BE1-32R Power Relay A2E D1R A0N0F
  • Basler Electric BE1-32R Power Relay A2E D1R A0N0F
  • Basler Electric 8650C80G01 Isolation Transducer PCB Board
  • ETEL EA-P2M-300-4/7.5A-0100-01 AccurET Modular 300 Servo Drive
  • Basler Electric 87T Transformer Differential Relay
  • Basler Electric BE-6868 Power Transformer 5950007559202
  • Basler Electric PRS250 Veri-Sync Relay 9088800102
  • Basler Electric SCP-250-G-60 VAR Power Factor Controller
  • Basler DECS-150 AVR 1NS2V1N1S Voltage Regulator
  • Basler UFOV 260A Under Frequency Overvoltage Module
  • Basler MOC2 199 Motor Operated Control – Overview and Setup
  • Basler BE3-49R-5K5A1 Temperature Relay – Complete Guide
  • Basler BE 20035 001 Transformer – Technical Data and Installation
  • Basler BE 02727 001 Transformer – Specifications and Usage
  • Basler BE127 Under Voltage Relay – Features and Application Guide
  • Basler CBS377 Current Boost System – Complete Technical Guide
  • Basler BE1-87G P/N 9170818100 Differential Relay – In-Depth Specs
  • Basler BE1-87G Generator Differential Relay – Technical Overview
  • Basler Electric SR4A2B16 SVR Static Voltage Regulator – Complete Guide
  • Basler Electric 9261500101 Power Supply Module
  • Basler Electric AEM-2020 Analog Expansion Module
  • Basler Electric DGC-2020 Digital Genset Controller 51BRBNEAH001
  • Basler Electric BE1-59N Ground Fault Overvoltage Relay
  • Basler Electric BE1-59N-A5E-E1L-N0S1F Neutral Overvoltage Relay
  • Basler Electric MOC2499 Motor Operator Control Potentiometer 9072300430
  • Basler Electric BE1-50/51M Overcurrent Relay
  • Basler Electric 9148100106 MOC3502 Solid State Relay 250VDC 0.25A
  • Basler Electric CBS 212 Current Boost System 9265000100
  • Basler Electric 10493002 Control Module
  • Basler BE1-32R D3E E1R A0N1F Power Relay
  • Basler SR8A2B15B3A Static Voltage Regulator
  • Basler IFM-105 Firing Circuit Chassis 9324100105
  • Basler SR4A2B05B3A Static Voltage Regulator