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

  • 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
  • Alcatel-Lucent 3HE06151ABAA01 SFP Line Card
  • Alcatel-Lucent 8DG59242AD Power Filter
  • Alcatel-Lucent IMM48-1GB-TX 48-Port Module
  • Alcatel Lucent 3CM03285MQ02 Module
  • Alcatel 3HE07158BA 7750 SR-12 IMM-2PCA-FP3 Optical Transceiver
  • Alcatel-Lucent 9396 Digital 2U NodeB Outdoor with Indoor Mainframe and Alarm Module
  • Alcatel Lucent MPX-16/64-T-L3 MPX1664TL3 Multiplexer Module
  • Alcatel Lucent 3EH73052AB Power Supply Module
  • Alcatel Lucent ASM2-155FM-2W-4C ASM2155FM2W4C Switch Fabric Module
  • Alcatel Lucent 3AL00124ABAB Interface Card
  • Alcatel-Lucent 1AB429380001 Cable Assembly
  • Alcatel Z24 3BA53065 Analog Extension Card 3BA53065AA
  • Alcatel-Lucent 9500-MPR 11GHz MPT-HC ODU Microwave Packet Radio 3DB20371ACAA01
  • Alcatel-Lucent RRH1900-4x45 Remote Radio Head
  • Alcatel-Lucent 3HE00028AA Ethernet Line Card
  • Alcatel-Lucent 3HE04939CE CWDM SFP Transceiver
  • Nokia Alcatel-Lucent 3FE66546AA Fan Module
  • Alcatel-Lucent SSP-6 Speech Signal Processor Board
  • Alcatel-Lucent 500-1113-212 Channel Bank Assembly
  • Alcatel-Lucent EZ32-2 Board 3BA23265ADKE 01
  • Alcatel-Lucent GSM-FM-2W-4C Filter Module
  • Alcatel-Lucent 3AL00378AF Interface Card
  • Alcatel-Lucent 3AL00124ABAC Interface Module
  • Alcatel-Lucent BJB1 PWPQALGAAG 48V Independent Microprocessor Board
  • Alcatel Lucent MDR-8000 Microwave Digital Radio MDR-8506-4 with 13 Modules
  • Alcatel Lucent 3AL00424AA Interface Card
  • Alcatel Lucent 3BA73012AB Power Supply Module
  • Alcatel Lucent ESX-100C-32W ESX100C32W Power Supply Module
  • Alcatel Lucent GSX-K-FM-2W GSXKFM2W Fan Module
  • Alcatel 8DG59247AA Optical Protection Switch Card
  • Alcatel Lucent 91-E03100-B 91E03100B Interface Module
  • Alcatel Lucent FSX-FM-1W FSXFM1W Fan Module
  • Alcatel Lucent RRH2X40-07L-AT Remote Radio Head
  • Alcatel-Lucent 9500-MPR MSS-8 Shelf 3DB18485CA
  • Alcatel Annecy ACP20 Vacuum Pump CP20
  • Alcatel-Lucent 9500 MPR P32E1DS1 E1 PDH Card
  • Alcatel-Lucent J98726AL-2 D4OI210DAA Module
  • Alcatel 409113651 RRH700L1 700MHz Remote Radio Head
  • Alcatel io2 3ba23050 PCB Card
  • Alcatel-Lucent MDR-8000 MDR-8706-8 Digital Radio