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 | 1074 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 BE1-700 Digital Protective Relay
  • Basler Electric SR8A-2B01B3A Static Voltage Regulator
  • Basler Electric SR4A-2B01B3E Static Voltage Regulator
  • Basler Electric 9017709102 PC Board
  • Basler Electric SR4A-2B01B3A Static Voltage Regulator
  • Basler Electric PRS-250 Veri-Sync Relay
  • Basler Electric 9066800102 Excitation Support System
  • Basler Electric BE1-87G Generator Differential Relay 9 1708 18 100
  • Basler Electric 36T865-2 BE03752001 Power Supply
  • Basler Electric M-300 149D940G02 Power Supply
  • Basler Electric ACA2040-25GM 4Mp 25Fps Area Scan Camera
  • Basler BE1-87G-S1A-A1C-A0N0 Differential Relay
  • Basler SR8A-2B06B3E Static Regulator SR8A2B06B3E
  • Basler SCP-210 Frequency Controller 9095400100
  • Basler BE1-59-A3E-A1J-N1N3F Overvoltage Relay BE159A3EA1JN1N3F
  • Basler 9 2011 11 100 Bracket Mounted Terminal Unit
  • Basler 9 1606 00 101 Voltage Regulator
  • Basler CBS-377 Current Boost System 9109600102
  • Basler 8650C72 Exciter Control Module PCB Rev 5
  • Basler C2EE1PA0N1F BE1-32R Reverse Power Relay
  • ADLINK HPCI-14S12U - Industrial Control Backplane 12PCI Backplane PCI-14S Passive Backplane
  • ADLINK PCIe-GIE74C - image acquisition card 4-CH GigE Vision PoE+ Frame Grabber
  • ADLINK PCI-8164 - control card 4-Axis Advanced Motion Controller Board
  • ADLINK PCIe-U304 - 4 Port USB3 PCIe Frame Grabbers USB Screw Hole Card
  • ADLINK PCI-9112 - Multi-Function Data Acquisition Card DAQ Card
  • ADLINK PCI-7432 - 51-12013-0A50 4-CH Isolated Numérique I/O PCI Cartes Digital I/O Card
  • ADLINK PCA-6106P3-0C1 REV.C1 - backplane 6-Slot Passive Backplane Board
  • ADLINK PCI-7224 - 24-CH Opto-Isolated Digital I/O PCI Board
  • ADLINK CPCI-7433R(G) - Digital Input Board Rear I/O CompactPCI Card
  • ADLINK EBP-13E4 - 51-46703-0A30 Industrial PC Backplane Passive Backplane
  • ADLINK PCIE-HDV62 - Image acquisition card High Definition Video Frame Grabber
  • ADLINK EBP-13E4 - 51-46703-0A30 Industrial Backplane Board Passive Backplane
  • ADLINK 90111-B1 / CPCI-6770 - PCB CPU MODULE CompactPCI Single Board Computer
  • ADLINK PCI-7248 - DATA ACQUISITION PCI CARD 48-CH Parallel Digital I/O Board
  • ADLINK PCI-7230 - 51-12003-0a50 board PCI7230 32-CH Isolated Digital I/O Card
  • ADLINK PCI2A000CB - 51-20000-0B30 Multi-Function DAQ Card Baseboard
  • ADLINK PCI-8134-005 - 4-Axis Motion Controller Card
  • ADLINK PCI-7224 - 24-CH Opto-Isolated Digital I/O PCI Card
  • ADLINK PCI-7434 - 64-CH Isolated Digital Output Card
  • ADLINK PCI-8132 - motion control card 2-Axis Servo & Stepper Controller
  • ADLINK PCI-8134 - Motion Controller PCI Card 4-Axis Controller Board
  • ADLINK PCI-8164 - Motion Control Card 51-12406-0A40 4-Axis Controller
  • ADLINK 51-12001-0C20 - Circuit Board Data Acquisition Interface Module Hardware
  • ADLINK NuPR0-840 - industrial control motherboard Full-Size PICMG CPU Board
  • ADLINK PCI-7444 - 51-12023-0A10 card 128-CH Isolated Digital Output Board
  • ADLINK PCI-1612B - data acquisition card 4-Port RS-232/422/485 Serial Communication Card
  • ADLINK PCI-6208V 009 - 8/16-CH 16-Bit Analog Output Cards PCB-I-E-482=6BX3
  • ADLINK NUPRO-935A/LV - industrial control motherboard Full-Size PICMG SBC Board
  • ADLINK PCI-9114DG - Multi-Function DAQ Card Data Acquisition PCI Card
  • ADLINK ACL-7130 - Data acquisition card Isolated Digital I/O Board
  • ADLINK ABX-6300D-4E1-BP - board ABX6300D4E1BP Video Interface Expansion Card
  • ADLINK CPCI-6940 - CPCI-6940/D1539/M16-0(EA)-000E 6U CompactPCI Processor Board
  • ADLINK NuPRO-760 - industrial control motherboard Half-Size PICMG SBC CPU Board
  • ADLINK IMB-M42H (G)-0020 - industrial control motherboard LGA1155 Micro-ATX Mainboard
  • ADLINK RTV-24 / PCI-MP4S - 51-12519-1C30 4-Channel Real Time Video Capture Board
  • ADLINK PCI-8134 - 4-Axis Servo & Stepper Motion Controller Card
  • ADLINK MXC-6101D - V.PC000.002.ST.00 Box PC Configurable Embedded Computer
  • ADLINK PCI-8134A - 51-12421-0A10 Motion Control Card 4-Axis Controller Card
  • ADLINK DIN-100S / DIN-100SA1 - Technology SCSI-II TB 100-PIN Terminal Block Board
  • ADLINK DIN-812M001 / DIN812M001 - 51-14034-0A1 51140340A1 Terminal Module Breakout Interface
  • ADLINK PCI-8164 - Servo motion control 4-Axis Advanced Controller Card
  • ADLINK PCIe-GIE64 - Acquisition card GigE Vision PoE+ Frame Grabber
  • ADLINK M-302 - Industrial control motherboard ATX PC Board Mainboard
  • ADLINK PCI-8134 - Motion Controller PCI Card 4-Axis Controller Board
  • ADLINK PCI-RTV24 - Image capture card Analog Video Frame Grabber
  • ADLINK PCI-8102 - Motion control card 2-Axis Servo & Stepper Controller Board
  • ADLINK PCI-9112 REV.B1 - Card Multi-Function Data Acquisition Card
  • ADLINK HSI-DI32-M-N / HSL-TB32-M-DIN - Discrete I/O MODULE Distributed Automation Module System
  • ADLINK PCI-7296 - IO card REV.A3 96-CH Parallel Digital I/O Card
  • ADLINK DIN-814P-A4 / 814Y - terminal board Motion Control Interface Block
  • ADLINK DIN-814P-A4 - 51-14056-0A10 PCB-I-E-2736=ZA01 Screw Terminal Board Breakout
  • ADLINK M-322 - motherboard Industrial Control Computer Mainboard
  • ADLINK NUPRO-406 REV:B1 - industrial control motherboard Full-Size PICMG CPU Board
  • ADLINK AMP-204C - card DSP-Based 4-Axis Advanced Pulse-Train Controller
  • ADLINK HPCI14S REV.B1 - industrial computer baseboard 14-Slot Passive Backplane
  • ADLINK PCI-7250 - 8-CH Relay Output & 8-CH Isolated DI PCI Card
  • ADLINK EBP-13E2 - baseplate Passive Backplane Industrial Computer Chassis Board
  • ADLINK LPCI-3488A - PCI-GPIB card 51-12801-0A30 acquisition card IEEE-488 Interface Board
  • ADLINK PCI-6216V-GL - 51-12201-0C30 16-CH 16-Bit Voltage Analog Output Card
  • ADLINK ACL-8454 - 16-CH Isolated Digital I/O & 4-CH Counter Card
  • ADLINK HPCI-9S7U - backplane Passive Backplane Compatible with NuPRO-A301 852 841 842
  • ADLINK DAQ-2010-007 - Simultaneous-Sampling Multi-Function Data Acquisition Card
  • ADLINK MP-C154 - 51-64205-0A10 Motion Control Card 4-Axis Controller Board
  • ADLINK MXE-202/mSSD16B/WiFi-BT - Matrix Rugged I/O Platform Embedded Fanless Computer
  • ADLINK CM-920-R-17 - PC/104-Plus Single Board Computer Module Intel Celeron M
  • ADLINK PCI-7250 NSMP - 8-CH Relay Output & 8-CH Isolated DI Card
  • ADLINK PCI-8164 - 4-Axis Motion Controller PCI Card W/ Cable and Breakout Box
  • ADLINK EMX-100 - Ethernet-based 4-axis Motion Controllers Distributed Motion Module
  • ADLINK PCI-8134A - Press control card 4-Axis Motion Controller Board
  • ADLINK M-845EG REV:3.2 - industrial motherboard Pentium 4 Socket 478 Micro-ATX
  • ADLINK PCI-9114A Rev A2 DG - card High-Resolution Multi-Function Data Acquisition Board
  • ADLINK IEC-915GV - REV 1.1 Industrial motherboard Socket 478 CPU Board
  • ADLINK PCI-9111DG(G) - Data Acquisition Card Multi-Function DAQ Card
  • ADLINK HPCI-15S10 REV:B2 - Industrial computer base plate Passive Backplane Board
  • ADLINK NuPR0-840 / NuPR0-840DV - industrial control motherboard Full-size PICMG CPU Board
  • ADLINK RTV-24 / PCI-MP4S - 51-12519-1C30 4-Channel Real Time Video Capture Board
  • ADLINK NUPRO-780 - industrial control motherboard Pentium III Single Board Computer
  • ADLINK PCI-7296 - 0050 card 96-CH Opto-Isolated Parallel DIO Card Set
  • ADLINK NUPRO-780 - industrial control motherboard PICMG Full-Size SBC
  • ADLINK PCI-7248 - 51-12006-0A3 002 Pci 7248 48-CH Parallel Digital I/O Card
  • ADLINK PCI-7230 - 32-CH Isolated Digital I/O Card
  • ADLINK AMP-204C - motion control card 4-Axis Advanced Controller Board
  • ADLINK PCI-1714UL - Card Ultra High-Speed 4-CH Simultaneous Sampling DAQ
  • ADLINK NuPRO-E330 - industrial computer equipment motherboard PICMG 1.3 SHB SBC
  • ADLINK AMP-204C - DSP-Based 4-Axis Advanced Pulse-Train Motion Controller Module
  • ADLINK PCI-7256 - 001 51-12206-0A2 REV.A2 LPCI-7256 16-CH Latching Relay Output Card
  • ADLINK ND6050 - NUDAM DIGITAL I/0 MODULE Distributed I/O Unit
  • ASEM BM100 - Box PC Embedded Fanless Industrial Computer
  • ADLINK PCI-7250 - PCI Acquisition Card 8-CH Relay Output & Isolated DI Board
  • ADLINK PCI-8164 - Servo motion control 4-Axis Controller Card
  • 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