Welcome to the Industrial Automation website!

NameDescriptionContent
HONG  KANG
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)

来源: | 作者:佚名 | 发布时间 :2023-11-21 | 699 次浏览: | 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) :

  • RELIANCE VZ3000G UVZC3455G Drive System Module
  • Reliance Electric S-D4039 Remote I/O Head Module
  • RELIANCE 0-57210-31 Industrial Drive Control Module
  • RELIANCE 0-56942-1-CA Control System Module
  • Reliance Electric 0-57100 AutoMax Power Supply Module
  • RELIANCE 0-54341-21 Industrial Control Module
  • RELIANCE 0-52712 800756-21B Drive Interface Board
  • RELIANCE 0-57170 Industrial Drive System Component
  • Reliance Electric S-D4030-A Remote I/O Head Module
  • RELIANCE 0-57406-E Industrial Control Module
  • RELIANCE 57401-2 Control Interface Module
  • RELIANCE 57421 Electrical Control Component
  • Reliance Electric 57401 Remote I/O Head Module
  • RELIANCE S-D4007 Industrial Control Module
  • ABB SACO16D1-AA Digital Annunciator Unit
  • RELIANCE 803.65.00 Control Board for Industrial Systems
  • Reliance Electric 57C404C AutoMax Processor Module
  • RELIANCE 0-57C411-2 Industrial Control Module
  • RELIANCE 0-57C408-B Heavy-Duty Industrial AC Motor
  • Reliance Electric 0-57C406-E AutoMax Power Supply Module
  • RELIANCE 0-57C407-4H Industrial Control Module
  • RELIANCE 0-57C405-C Industrial Duty AC Electric Motor
  • Reliance Electric 0-57C404-1E AutoMax Processor Module
  • RELIANCE 0-57C402-C Drive Control Module
  • RELIANCE 0-57C400-A High-Performance Industrial AC Motor
  • Reliance Electric 0-51378-25 Digital Interface Board
  • RELIANCE S-D4041B Drive Control Module
  • RELIANCE INSPECTOR VCIB-06 Vibration Calibration Instrument
  • Reliance Electric S-D4043C Remote I/O Head Module
  • RELIANCE S-D4012 Drive Control Module
  • Reliance Electric 805401-5R Printed Circuit Board
  • RELIANCE ELECTRIC 0-60029-1 Drive Control Module
  • REXROTH VT-HNC100-1-23/W-08-C-0 Digital Axis Control
  • REXROTH VT-HNC100-4-3X/P-I-00/G04 Digital Axis Controller
  • REXRTOH VEP40.3CEN-256NN-MAD-128-NN-FW Industrial Embedded PC
  • Rexroth 0608820116 ErgoSpin CC-AS300-070 Tightening Tool
  • REXROTH MHD093C-058-PG1-AA Synchronous Servo Motor
  • REXRTOH VT-HNC100-1-22/W-08-C-0 Industrial Touch Monitor
  • Rexroth MSK060C-0600-NN-S1-UP1-NNNN IndraDyn S Servo Motor
  • REXRTOH VT3024 Industrial Monitor
  • Rexroth MHD041B-144-PG1-UN Synchronous Servo Motor
  • Rexroth VT-HNC100-1-23/W-08-S-0 Digital Axis Control
  • Rexroth VT-HNC100-1-23/M-08-P-0 Controller
  • REXRTOH VT-HNC100-1-22/W-08-0-0 | Hydraulic Valve Block Assembly
  • Rexroth 4WE6Y62/EG24N9K4 + HSZ10-26916-AA/G24N9K4M01 Assembly
  • Rexroth MHD095C-058-NG1-RN Hydraulic Motor
  • Rexroth 4WE6Y62/EG24N9K4 + HSZ10-26916-AA/G24N9K4M01 Assembly
  • Rexroth SYHNC100-NIB-2X/W-24-P-D-E23-A012 Controller
  • REXRTOH BTV04.2GN-FW | Bus Terminal Valve with PROFINET
  • Rexroth BGR DKC02.3-LK SCK02/01 ECODRIVE3 Control Assembly
  • Rexroth MKD025B-144-KG1-UN Servo Motor
  • REXRTOH R901325866+R900775346+R901273425A | Drive System Component Set
  • Rexroth CSH01.1C-SE-EN2-NNN-NNN-NN-S-XP-FW Drive Controller
  • REXRTOH DDS2.1W200-D | Digital Servo Drive
  • Rexroth VT3002-2X/48F Card Holder for Proportional Amplifiers
  • Rexroth VDP40.2BIN-G4-PS-NN Proportional Valve
  • REXRTOH MSK070D-0450-NN-M1-UP1-NSNN Servo Motor
  • Rexroth MSK070C-0150-NN-S1-UG0-NNNN IndraDyn S Servo Motor
  • Rexroth MSK050C-0600-NN-M1-UP1-NSNN Servo Motor
  • Rexroth MSK030C-0900-NN-M1-UP1-NSNN Servo Motor
  • Rexroth TV 3000HT PUMF Hydraulic Pump Module
  • REXRTOH R911259395 | Drive System Control Module
  • Rexroth VT-VSPA1-1-11 Proportional Amplifier Card
  • Rexroth VT3006S35R1 Proportional Valve Module
  • REXRTOH VT3006S34R5 Hydraulic Valve | Directional Control Valve
  • Rexroth VT3000S34-R5 Proportional Amplifier Card
  • Rexroth SL36 Servo Motor Controller
  • REXRTOH SE200 0608830123 | Inductive Proximity Sensor
  • Rexroth RAC 2.2-200-460-A00-W1 Main Spindle Drive Controller
  • Rexroth PSM01.1-FW Power Supply Module
  • REXRTOH PIC-6115 | Programmable Industrial Controller
  • Rexroth MDD112D-N030-N2M-130GA0 Digital AC Servo Motor
  • Rexroth HDS03.2-W075N Drive Controller Module
  • REXRTOH DKC03.3-040-7-FW Servo Drive | Digital Motion Controller
  • Rexroth DKC02.3-200-7-FW ECODRIVE3 Servo Drive Controller
  • Rexroth CSB01.1N-AN-ENS Control System Module
  • REXRTOH 0608830222 | Genuine Automation Component
  • Rexroth 0608830174 ErgoSpin Tightening System Control Module
  • Rexroth 0608820103 Industrial Hydraulic Control Component
  • REXRTOH 0608820069 Industrial Automation Component
  • Rexroth 0608800048 ErgoSpin Tightening System Control Module
  • Rexroth 0608801006 Industrial Hydraulic Control Component
  • REXRTOH SYHNC100-NIB-24-P-D-E23-A012 Encoder | Synchronous Serial Interface
  • Rexroth 0608720040 ErgoSpin Tightening System Control Module
  • REXRTOH SYHNC100-NIB-2X/W-24-P-D-E23-A012 Controller
  • ABB CP555 1SBP260179R1001 HMI Operator Terminal
  • HIMA K9212 Fan Assembly | Safety System Cooling Unit
  • WATLOW CLS208 Digital Temperature Controller
  • Watlow CLS2163C1-110200000-CLS204204-C10000AA-CLS208208-C10000AE Multi-Loop PID Controllers
  • WATLOW PPC-TB50 Power Controller
  • WATLOW PPC-TB50 30280-00 Temperature Controller
  • Watlow NLS300-CIM316 Communication Interface Module
  • WATLOW MLS300 Limit Controller
  • WATLOW CAS 16CLS/CAS Temperature Controller
  • Watlow CAS200 CLS216 16-Loop Thermal Controller Module
  • WATLOW CLS208 C10000CP Power Controller
  • WATLOW ANAFAZE LLS200212 CLS208 Temperature Control System
  • Watlow ANAFZE PPC-TB50 CLS208 Multi-Loop Controller
  • WATLOW ANAFZE 997D-11CC-JURG Power Controller
  • WATLOW ANAFAZE PPC-TB50 Temperature Controller
  • ABB SUE3000 1VCF750090R0804 High-Speed Transfer Device
  • ABB TET106 11355-0-6050000 Temperature Module
  • ABB PPD512 A10-15000 Power Panel Display
  • ABB PPD113B01 3BHE023784R1023 AC 800PEC Control Module
  • ABB PFEA113-65 Tension Controller 3BSE050092R65
  • ABB PFEA112-20 3BSE050091R20 Fieldbus Adapter Module
  • ABB PFEA111-65 3BSE050091R65 Tension Electronics PFEA111
  • ABB PFEA111-65 Tension Controller 3BSE050090R65
  • ABB PDD500A101 Operator Display Panel | Industrial HMI Interface
  • ABB KP2500 Process Control System Controller
  • ABB CP405 A0 Operator Panel 1SAP500405R0001
  • ABB AX411/50001 Digital Input Module
  • ABB 500TRM02 1MRB150011R1 Procontrol P13 Bus Terminal Module
  • ABB 500TTM02 Temperature Module 1MB150021R0116
  • ABB 500TRM02 1MRB150011R0001 Terminating Resistor Module
  • ABB 500SCM01 1MRE450004R1 Control Module
  • ABB 500SCM01 1MRB200059/C 1MRB150044R0001 Station Control Module
  • ABB 500SCM01 1MRB150004R00011MRB200059/C Control Module
  • ABB 500PSM03 1MRB 150038 R1 894-030375D 136-011100H Power System Module
  • ABB 500PSM03 1MRB150038 R1 894-030375D 136-011100H Power Supply Module
  • ABB 500PSM02 1MRB150015R1 AD-272.100.20-01 AZ:C Power Supply Module
  • ABB 500PB101 1MRB178009R00011MRB200064/C Power Supply Module
  • ABB 500MTM02 1MRK001967-AA 1HDF 930512 X010 Module
  • ABB 500MTM02 1MRB150020R1102 1HDF 930512 X010 Motor Module
  • ABB 500MTM02 1MRB150020R0712 Touch Module
  • ABB 500MBA02 1MRB150003R0003 1MRB200053/M Bus Coupling Module
  • ABB 500MBA01 1MRB150003R00021MRB200053/L Motor Control Module
  • ABB 500MBA02 1MRB150003R000/B Analog Output Module