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

  • Atlas Copco 49X10301AB Pressure Transducer Sensor
  • Atlas Copco 8436180002 Replacement Filter Element
  • Atlas Copco C4700A01V216 Compressor Control Module
  • Alcatel-Lucent 3HE01019AAAA01 High-Speed Interface Module
  • Alcatel-Lucent 111381 Power Distribution Module
  • Alcatel TN 2523 1:1 CDN III Module – MRPQAE3
  • Alcatel-Lucent 3he06151aaac01 8-Port Interface Module – IPUIBKB3AA
  • Alcatel-Lucent LNW46 DMX Metro OC12 Interface Module – 108694878
  • Alcatel-Lucent 41A12C FT-2000 Optical Transponder Unit – 108188053
  • Alcatel-Lucent 8DG02607AA POW100 DC-DC Converter Module
  • Alcatel-Lucent LambdaXtreme WWBQ21 40G Optical Transponder
  • Alcatel-Lucent TN1891 5ESS Protocol Handler PHV5 Commcode 108747064
  • Alcatel-Lucent 300-0303-900 T1D3PDL1AE Digital Matrix Card
  • Alcatel-Lucent G-821M-A Module
  • Alcatel Lucent MPT-GC Eth 1G+ARM TX 81-86GHz 3DB80005AAAAO1
  • Nokia 3KC48990AB 1830PSS 16FAN2 Fan Unit
  • Alcatel 3EC17041AA PSPC-G4 PCB CP011200552
  • Alcatel 300-0437-906 Rev F DEXCS DMC T1D1L0S Module
  • Alcatel-Lucent 3DW03697ABBA01 TFD64A Module
  • Alcatel-Lucent AWR12 S1-1 UN Interface T3PQAC3AAA
  • ALCATEL LUCENT 9500-MPR ODU RADIO MPT-HC V2 9558HC 3DB20914BAAA03 6GHZ
  • Alcatel-Lucent 9500-MPR ODU 300 11GHz Microwave Radio MPT 3DB23035AEAA01
  • Alcatel 2C7-1005-000 Teflon Bell Jar Holder Ring – 146111
  • Alcatel-Lucent BNJ118 S1:4 Circuit Board – Interface Module
  • Alcatel-Lucent 9500-MPR ODU 300 6GHz Microwave Radio MPT 3DB23215AFAA01
  • Alcatel 3EM04001AA Signal Processing Unit with Accessory Cards
  • Alcatel VAUCAL5KAB AA1418FE2BG 3FE67437AAD02 Interface Card
  • Alcatel-Lucent 1642 Edge Multiplexer N1217P YF – Access Node
  • Alcatel-Lucent 3HE07158BA 7750 SR-12 12-Port 10GIGE MultiCore IMM IPUCA741AA
  • Alcatel 101200429000 Power Divider 746-776 MHz with Heatsinks
  • Alcatel-Lucent 9500-MPR ODU 300 MPT 6GHz 3DB23215ADAA01 High Power Radio
  • Alcatel-Lucent 9500-MPR MPT-HC 23GHz 2/2P ODU Radio 3DB20474BA
  • Alcatel-Lucent 9500-MPR ODU 300 MPT 6GHz 3DB23215AAAA01 Low Power Radio
  • Alcatel 3BA52126ABAA OmniPCX 4400 Compact Cabinet
  • Alcatel-Lucent 3HE12300AA 7750 SR-1 Subrack with Licenses
  • Alcatel 300-1368-903 Rev C DEXCS SPA-1 T1PQAC1 Line Card
  • Alcatel-Lucent 408977981 WOWUAB6HAA 10G XPR OTU2 XPonder Card
  • Alcatel-Lucent-Nokia 3HE08423AARC01 7750 SR Control Processor Module IPUCBGZ1AA
  • Alcatel-Lucent 9500-MPR ODU 300 MPT 6GHz 3DB23215ABAA01 Low Power Radio
  • Alcatel-Lucent CPU7-2 3BA23259ABJE 05 Control Processor Module
  • Alcatel WTM11AD 3DW03915DABA01 Optical Transponder Module
  • Alcatel-Lucent 1340FMPK Card Chip BA5IVY6BAA – Processor Module
  • Alcatel-Lucent 3HE06151ACAC01 Control Fabric Module
  • Alcatel-Lucent 9500-MPR 18GHz 1P-1 Protection ODU Radio 3DB20433BA AA04
  • Alcatel-Lucent 9500-MPR ODU MPT-HC 18GHz Radio 3DB20433BAAA04
  • Alcatel-Lucent SM269 LMPQ04KAXX Circuit Pack – Interface Module
  • Alcatel OME25HP Filter Cartridge – 107494
  • Alcatel-Lucent ALU-BZ74 99BC-4 –48V Battery Cabinet
  • Alcatel-Lucent WWAA37 Optical Amplifier WMAPZNZAAB – CP Series
  • ALCATEL LUCENT 9500-MPR ODU RADIO MPT-HC V2 9558HC MPT-XP 3DB20476BAAA04 23GHZ
  • Alcatel Tyco Yukon ES760A Rectifier
  • Alcatel-Lucent 9500-MPR ODU 300 MPT 23GHz 3DB23045HMAA02 Microwave Radio
  • Alcatel-Lucent 9500-MPR ODU MPT-HC 11GHz 3DB20548ACAA01 Microwave Radio
  • Alcatel Lucent 3DH03173AKAA Module
  • Alcatel-Lucent 76-0300-02 CSM-V2 PCB
  • Alcatel 9400 UX ODU Module 3CC06729ABAA
  • Alcatel-Lucent 408981363 Jigsaw A Band Block 24/-48V KS24624L58
  • Alcatel 3BA53095 PCB Card
  • Alcatel 2C7-1005-000 Bell Jar Holder Ring Teflon PC7-1005-000
  • Alcatel-Lucent ES640 PWDQAGKUAA 5ESS 48V DC Alarm Control Unit
  • Alcatel-Lucent 9500-MPR ODU 300 23GHz Microwave Radio MPT 3DB23045HM
  • Alcatel-Lucent KFA720 WMOTCMVLAB Optical System Interface Carrier
  • Alcatel-Lucent 9500-MPR ODU MPT-HC V2 15GHz Microwave Radio 3DB20373BAAB04
  • Alcatel-Lucent AKM70 S1-7 SMUX1 Sub-Multiplexer – T3PQWAEAAH
  • Alcatel-Lucent 107486490 DDM-2000 SONET DS3 Circuit Pack – BBG4B
  • Alcatel-Lucent SBEVM BNJ82 1:12 Module – AV950-01168
  • Alcatel-Lucent 938A Optical Loss Set – Test & Measurement Kit
  • Alcatel-Lucent MS1025-25O16-ED Fiber Optic Unit – 48VDC
  • Alcatel-Lucent 9500-MPR ODU MPT-HC 23GHz 1/1P Microwave Radio 3DB20473BA AA04
  • Alcatel-Lucent bCEM-U Control Module – 3BK28676ABAC01
  • Alcatel ASI20 Detector Control Module
  • Alcatel Lucent 130B S-1 PWPQ08B Power Unit
  • Alcatel-Lucent 9500-MPR ODU MPT-HC V2 9558HC 6GHz 3DB20441BBAA02
  • Alcatel-Lucent 9500-MPR ODU MPT-MC 15GHz 3DB20824AAAA02 Microwave Radio
  • Alcatel-Lucent 9500-MPR ODU MPT-MC 15GHz 3DB20822AAAB02 Microwave Radio
  • Alcatel-Lucent 3AL92111AA 1P10GSO Interface Module
  • Alcatel 8220 CTT 450 Turbo Pump Controller 127821
  • Alcatel-Lucent 3AL78823AAAE 02 Module
  • Alcatel-Lucent 90-0413-01 Universal Card
  • Alcatel-Lucent BRMA 10Base-T/100Base-TX Connecting Box 3BA56170ACAB010842
  • Woodward Micronet 5453-279 Rev E Chassis Rack for TMR Control
  • Alcatel-Lucent KFA632 WMOTBUKLAA 10G Optical Interface Carrier
  • Alcatel-Lucent 9500-MPR ODU MPT-HC V2 3DB20474BAAB04 23GHz Microwave Radio
  • Alcatel-Lucent KFA720 WMOTCMVLAB SFP/XFP Optical Interface Carrier
  • Alcatel-Lucent 3AL00114AB Universal Interface Module
  • Alcatel-Lucent BBG9 S1:1 OHCTL Optical Hardware Control Module
  • Alcatel-Lucent FB16401-A-I03 GTD-5 Analog Master/Slave Control Board
  • Alcatel-Lucent MCR1721B Control Module
  • Alcatel-Lucent 9500-MPR 3DB20547ACAA01 ODU MPT-HC 11GHz Microwave Radio
  • Alcatel-Lucent 3HE01014AAAA02 Interface Module
  • Alcatel-Lucent 244-2091-005 High Density Digital Line Card V1.5
  • Alcatel-Lucent LAMBDAXTREME WWAA36 Optical Amplifier Module
  • Alcatel-Lucent 9500-MPR ODU MPT-HC 6GHz 2P-2 Radio 3DB20444BAAA05
  • Alcatel-Lucent 9500-MPR ODU MPT-HC V2 9558HC MPT-XP 6GHz 3DB20442BBAA02
  • Alcatel-Lucent 9500-MPR ODU MPT-HC 23GHz 3DB20476ABAA01 Microwave Radio
  • Alcatel Lucent 3HE01019AAAA01 Module
  • Alcatel CPU5 3BA23071 PCB Card with IO2 3BA23050 Set
  • Alcatel-Lucent 9500-MPR ODU MPT-HC V2 9558HC 6GHz 3DB20443BBAA02
  • Alcatel Lucent 500-1113-211 Rev H Channel Bank Assembly
  • Alcatel Lucent 89-0419-B-2 BA9ATS0FAB Frontal Compute Module
  • Alcatel-Lucent LambdaXtreme 1625 WWAF31 Optical Amplifier CP Module
  • Alcatel Z24 3BA53065 Analog Extension Card 3BA52065 AAAA KAZZB-01
  • Alcatel 3EH08263AAXX000448 OmniPCX Office Large PBX System
  • Alcatel Lucent VSEM-C 3FE62453 XA VAUCAJZKAA 7330 DSLAM Line Card
  • Alcatel-Lucent 9500-MPR ODU MPT-HC 3DB20432BAAA04 18GHz Microwave Radio
  • Alcatel-Lucent 9500-MPR ODU MPT-HC 3DB20546ACAA01 11GHz Microwave Radio
  • Alcatel-Lucent 3DB04823AAAA Circuit Board
  • Alcatel-Lucent 3DB04530AAAA Circuit Board
  • Westell MDIU Modular DAS Interface Unit CS21-005-105Q
  • Alcatel-Lucent 90-0423-01 Control Card
  • Alcatel-Lucent 3AL91792AA 01 iL-1.2 Optical Interface LC Connector
  • Alcatel-Lucent 109637454 WA82 SP2B MODL908832 – Interface Module
  • Alcatel-Lucent MDEE DPB11 Part 109773580 – Digital Processing Board
  • Alcatel 3EH76027ADAD OmniPCX Enterprise Communication Server R500/30.4
  • Alcatel-Lucent 3EH73084AEJD Gateway Driver Board GD-3 – Communication Interface
  • Alcatel-Lucent 9500-MPR ODU Radio MPT-HC V2 3DB20476BAAB04 23 GHz Microwave Outdoor Unit
  • Alcatel-Lucent 9396 Digital 2U NodeB Indoor – UMTS Base Station
  • Alcatel-Lucent 3HE03607AA CFM-XP Control Fabric Module – Switch Fabric Controller
  • Alcatel-Lucent 8232 DECT Mobile Handset – Cordless Enterprise Phone
  • Alcatel-Lucent 244-2082-201 Sierra NAC V3.1 Slave Package – Network Access Control
  • Alcatel-Lucent 408154912 CPU Rear I/O Pack Card – Backplane Interface Module
  • Alcatel-Lucent 3AL82037ADAA SFP Module
  • Alcatel-Lucent OMQ 408645968 Optical Module
  • Alcatel-Lucent 9500 MPR 8-Slot Shelf 3DB18485AB
  • Alcatel-Lucent 408154904 CPU I/O Card
  • Alcatel-Annecy 5150 CP Turbo Vacuum Pump
  • Alcatel-Lucent 3EH73084AEJD08 Card
  • Alcatel-Lucent 3EH73050ABAB Interface Card