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

  • Lust LTi Drives CDA34.010 W3.0 Frequency Inverter
  • LTi SO22.003.0010.0000.0 ServoOne Junior Drive
  • LUST LTi Drives CDA32.008 Servo Drive
  • LUST LTi DRIVES LSH-074 Servo Motor
  • Lti CDB32.004.C2.4.SH AC Servo Drive
  • Lust LTi Drives VF1202S Frequency Inverter
  • Lust LTI Drives CDB32.004.C3.0.SH Servo Controller
  • LUST SO84.012.0030.1700.2 Servo Drive
  • Lust LTi CDB32.004 Servo Drive
  • LUST LTI Drives CDA34.006 Servo Drive
  • LTi DRiVES BR-090.03.540-UR Braking Resistor
  • Lust LTI Drives CDA34.017 Servo Controller
  • Lust LTi Drives CDE34.010.D2.4 Positioning Controller 10A
  • LTi Drives LSH-050-3-30-48/T1 PM Servo Motor
  • LTI CDD34.005.C2.1 Servo Drive Controller
  • LUST LTI Drives CDB32.003.C2.4 Servo Drive
  • LTI D-35633 Drive Servo Drive Controller
  • LTI Drives GmbH SO22.003.0042.0000.0 Servo Controller
  • LTi Drives SO84.006.1030.0000.2 Servo Controller
  • LUST LTi Drives CDA32.008 C1.4 HF V180.15 1.5 kW
  • LTI Drives Servo One SO84.045.0010.0001.2-W 22 kW
  • Lust LTI CDE32.003.C2.4 Servo Drive Controller
  • LUST LTI Drives CDA34.003 Servo Controller
  • LUST LTI Drives CDA32.006 Servo Controller
  • Lust LTi Drives CDE32.004 Servo Drive
  • LUST LTi Drives SO84.012 Servo Controller
  • LTI DRIVES LSH-060 Servo Motor
  • LUST LTI Drives CDE32.004 with CM-DPV1
  • LTi DRiVES SO84.016 Servo Drive
  • LTI Drive CM-DPV1 Communication Module
  • LTi DRiVES DSM4-05.4-20R82-400 Servo Motor
  • LUST LTI Drives CDA34.003 Servo Controller
  • LTI Drives Servo One SO84.045.0010.0001.2-W 22 kW
  • LUST LTI Drives CDB32.008 W2.4 BR PC1 Servo Drive
  • LTi Drives SO84.006.1030.0000.2 Servo Controller
  • LTI DRIVES CDE34.010D2.4 Servo Drive Controller
  • Hettich Rotanta 46 RSC Control Board VF1204S
  • Lust LTI Drives CDA34.017.C2.CP Servo Controller 7.5 kW
  • LUST LTI Drives CDA34.003.C3.0 Servo Controller 0.75 kW
  • Lust LTI Drives CDA34.008.C1.3 Servo Controller 3 kW
  • Lust LTi Drives CDB22.004.0111.00.0 Servo Drive
  • LTi Drives SO84.032.0030.1000.2 Servo Controller
  • LUST LTi CDA32.004 C1.4 H08 B0 Servo Controller
  • LTI DRIVES CDB34.010 C2.4 Servo Drive
  • LUST LTi Drives CDA32.008 C1.4 Servo Controller
  • LTI Motion CDE32.003.C3.0 Servo Positioning Controller
  • LTI DRIVES CDE34.010 D2.4 Servo Drive Unit
  • LUST LTi Drives CDD34.005.C2.1 Servo Drive
  • LTi Drives SO84.012.0002.0100.2 Servo Controller
  • LUST LTi Drives CDE34.010.D2.4 Servo Drive
  • LUST LTI Drives CDF30.008 Servo Drive
  • LTi Drives SO CM-P.0010.11.00.0 Power Module
  • LTi DRiVES SO84.008.0002.0100.2 Servo Controller
  • LTI MOTION Servo Drive SO22.006.0040.1000.1
  • LTi DRiVES SO24.007.0030.1000.0 ServoOne Junior
  • LTi DRiVES LUST BC1300 Braking Module
  • LUST LTI DRIVES CDE34.010 Variable Frequency Drive
  • LUST LTI DRIVES CDA32.004 Servo Drive
  • LTi DRiVES LST-074-2-30-560/T1 Servo Motor
  • LUST LTI DRIVES CDB32.008 Servo Drive Module
  • Lust Antriebstechnik LTI Drives VF1204S Inverter
  • Lust LTI Drives CDE32.008 C3.0 Positioning Controller
  • LTI Drives LUST Servo One C-5633 D-35633
  • Lust LTI Drives CDA34.008.C1.3 Servo Controller 3kW
  • LTI CDF30.008 C2.6 Servo Drive 10962161
  • LUST LTi Drives CDB32.004 C2.3 SH Servo Drive
  • Lust LTi Drives CDE34.010 D2.0 Servo Drive
  • LTi Motion CDA32.006 Servo Drive with CM-CAN1
  • Lust LTI Drives CDB32.008 C2.3 Servo Controller
  • LTi CDE34.017.W3.0 Servo Drive
  • LUST LTI LST-074-2-30-320/T1 Servomotor
  • Lust LTi CDF30.002 C3.0 Positioning Controller
  • LTi DRIVES CDF30.008.C2.4 Drive
  • LUST LTI CDB32.008 W2.4 BR PC1 Drive
  • LTi SO84.004.0002.0100.2 Servo Controller
  • LTi SO84.012.0030.0011.2 ServoOne Drive
  • LTI Drives LUST Servo One C-5633 D-35633
  • LTi DRiVES c-line Smart Card A028.V01.1
  • LUST LTI CD A34.008 W1.4 BR Drive
  • LUST LTI LSH-097-2-30-560/T1 Servomotor
  • LUST LTI LST-074-2-30-320/T1 Servomotor
  • LUST LTi CDB32.004 C2.4.SH Servo Drive
  • LTI Drives PM-E40.2DRA054P Pitch Inverter
  • Lust LTI Drives CDF30.008 Servo Drive 8673548
  • LTI Drives CDF30.002.C0.7 Servo Controller
  • Lust LTI Drives CDB32.008.W2.4 Servo Drive
  • Lust LTI Drives CDB34.003 Servo Motor Driver
  • Lust LTI Drives CDA32.004 Servo Drive 3084456
  • Lust LTI Drives CDE34.005.W2.2 Servo Drive
  • Lust LTI Drives CDA34.006.W3.0 Servo Drive
  • LTI Drives CDF30.008.C2.4 Servo Controller
  • LTI Drives Lust CDB32.004.C2.4.SH Servo Drive
  • Delta Design 1666339-501 Micro Stepper PCB 114970
  • APEXEL 100X Microscope Mobile LED Pocket Lens
  • Micro Innovation XV-152-D4-10TVR-10 Touch Screen
  • Micro Innovation XVH330-57MPI-1-10 Touch Screen Glass
  • Delta Design 1666339-501 Micro Stepper PCB 114967
  • Micro Design MC100-MA V3 Board
  • Delta Design 1666339-501 Micro Stepper PCB 114968
  • Delta Design 1666339 PCB Micro Stepper ITR 116487
  • Micro Innovation XV-440-10TVB-1-10 Panel
  • Sterling 9B21-3 Micro Switch Durable Design
  • ATTINY104-XNANO Microchip AVR Prototype Board
  • Delta Design 1666339 Micro Stepper PCB ITR 116539
  • Super Micro X7SBJ Industrial Main Board
  • Delta Design NMS BD 1698437-501 Stepper Board
  • Micro Innovations Turbo Track Keyboard KB420BL
  • Micro Design PC-1 PC-1-H-DU010 Operator Panel
  • TCI MICRO MD 250mA 7W Dimmable LED Driver
  • Delta Design 1666339 Micro Stepper PCB ITR 116485
  • Delta Design NMS BD 1698437-501 Stepper Board
  • Life Instruments 714-1120-1U Micro Curette
  • Delta Design 1657925-501 Micro Processor PCB
  • Micro 100 RTC-125-2 Carbide Engraving Tool
  • Micro Design Inc. 2106022 Liquid Level Sensor PCB
  • Periodontal Micro Surgical Full Kit 20pc Blue Titanium K1004
  • Micro Innovation XN-2DO-24VDC-0.5A Module
  • Wide Innovative Technology PS-01 Micro Positioner Set
  • HU FRIEDY NH5020 Castroviejo Needle Holder Set
  • Moeller Micro Innovation XV-232-57BAS-1-10 Touch Screen
  • Micro Design System MCVP-300VR Control Module 24VDC
  • Scanlan 3003-234-1 Titanium Jacobson Needle Holder
  • Micro Innovation XV-102-B0-35TQR-10-PLC Panel
  • Promot Micro Design 3x8 Output 2187F
  • Micro Innovation LIC-SW-Galileo 91 30 000600 License Certificate
  • Micro Design AI0486.A4-50 Control Module Board
  • Micro Innovation XN-2DO-24VDC-0.5A Output Module
  • Micro Design Not-Aus Relais AE 8.96 AE 896