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

  • MICRO INNOVATION MK2-230/232-57 Circuit Board 85 28 200000
  • MICRO INNOVATION CAN-BRIDGE 8551224177 CAN Bridge
  • Micro Innovation MC2-430-10TVB-1-10 Panel 24VDC
  • MICRO INNOVATION MC2-432-57CQB-1-10 HMI Panel
  • MICRO INNOVATION AG CAN-BRIDGE 85 51 224177 CAN Bridge
  • MICRO INNOVATION CAN-4AI/UI Analog Input Module
  • MICRO INNOVATION CAN-32DI/P-2X16 Input Module
  • SIGMATEK MDD111 09-404-111 Drive Module
  • SIGMATEK DVI021 Display Interface Module
  • SIGMATEK 00-450-024 C-IPC Processor
  • SIGMATEK MDD-111 MDD111 Drive Module
  • SIGMATEK ICA011 20-102-011 Interface Module
  • SIGMATEK 01-250-010-D NC4Kompakt Control Module
  • SIGMATEK CRIF081 12-751-081 Interface Module
  • SIGMATEK S1026-8AF61-R4E-Z57 Drive Module
  • SIGMATEK 9305.081.02 9227.082.00 Control Module
  • Sigma Tek 5000B-36 Attitude Indicator
  • SIGMATEK CEZ201 12-051-201-O Counter Module
  • SIGMATEK DPS001 Power Supply Module
  • SIGMATEK 994 395 01z Via Interface Module
  • SIGMATEK PC411-K 01-310-411-K Industrial PC
  • SIGMATEK 9816.324.00 Demag NC4 Keyboard
  • SIGMATEK ET261 90010C-71 Operator Terminal
  • SIGMATEK DDI 164 05-006-164 Input Module
  • SIGMATEK CCP 082 C-DIAS Processor Module
  • SIGMATEK CEZ201 12-051-201-O PLC Module
  • SIGMATEK MDD 1111 06178867 Drive Module
  • SIGMATEK S1 073-6AC61-RE-Y08-Z Drive Module
  • SIGMATEK MDD 111 Drive Module MDD111
  • SIGMATEK CSDI161 Safety Module 12-891-161
  • SIGMATEK C-IPC Processor 01-450-024
  • SIGMATEK DIAS DAM122 Analog Mixing Module
  • Sigma Tek 5000B-36 Attitude Gyro Indicator
  • SIGMATEK TMS012 Motherboard Module 05-250-012-T
  • SIGMATEK CCP-531 PLC Module
  • SIGMATEK DIAS DNC4 I/O Module 05-250-011
  • SIGMATEK AI088 Analog Input Module
  • SIGMATEK CEZ201 Counter Module
  • SIGMATEK CIC011 Industrial Computer Module
  • SIGMATEK MDM021 Motor Drive Module
  • SIGMATEK DTO163 Digital Output Module
  • SIGMA-TEK 5000B-36 Attitude Gyro
  • SIGMATEK DM161 Digital Input Module
  • SIGMATEK CCP-531 PLC Control Panel
  • SIGMATEK HZS773 Touch Terminal Operator Panel
  • SIGMATEK MDP101 3 KVA 45-65Hz Driver
  • SIGMATEK ETV1251 Touch Panel 12-230-1251
  • SIGMATEK CIO021 Safety Module 12-013-021
  • Sigma Tek 4000H-5 Directional Gyro
  • SIGMATEK TAE531 I/O Module 01-240-531
  • SIGMATEK DAI081 Input Module 05-009-081
  • SIGMATEK DCP640 Drive Control Module
  • SIGMATEK DCP643 Slides Module A6-29
  • SIGMATEK SCP011 Safety Module 20-890-011
  • SIGMATEK DDM 164-D Slides Module
  • SIGMATEK C-IPC Processor 146267
  • SIGMATEK ET3200 Display Screen
  • SIGMATEK CEZ221 C-DIAS Mixing Module
  • SIGMATEK SDD120-2 DIAS Servo Drive
  • SIGMATEK DIP011 05-058-011 Module
  • Sigmatek DEC181 I/O Module
  • SIGMATEK DCP640 DIAS Central Unit
  • SIGMATEK 00-450-024 C-IPC Industrial Computer
  • SIGMATEK AKM32C-ANCNR-B0 Servomotor
  • SIGMATEK DVI021 DIAS Power Module
  • SIGMATEK CTS051 12-053-051 Control Module
  • SIGMATEK CTS022 Control Module
  • Sigmatek 01-250-010-D NC4Kompakt V2.1 Module
  • SIGMATEK Control Keyboard 01-285-042 Interface
  • SIGMATEK TO081 20-007-081 Digital Output Module
  • Sigmatek AKM73Q-ANCNGBB0 7.07kW Servo Motor
  • Sigmatek DIP012 Demag 07024165 Processor Module
  • SIGMATEK PC 411 Injection Molding Controller
  • SIGMATEK CEZ201 12-051-201-O Processor Module
  • SIGMATEK VI021 20-003-021 Digital Input Module
  • SIGMATEK Computer C-IPC 144904 Industrial PC
  • SIGMATEK 9307.083.01 9305.081.02 Industrial Module
  • SIGMATEK AI075 Analog Input Module
  • SIGMATEK HGT834-W Teaching Pendant
  • Sigmatek CDI161 Digital Input Module
  • SIGMATEK HGT834 Teaching Pendant
  • SIGMATEK CEZ201 12-051-201-O Module
  • SIGMATEK Demag 9617.067.03 9708.244.00 Module
  • SIGMATEK SCP010 Safety CPU Module
  • SIGMATEK N100 20-011-100 Module
  • SIGMATEK CNC 031 Positioning Output Module
  • Sigmatek 01-355-016 Control Module
  • Sigmatek MDM021 Digital Mixed Module
  • Sigmatek DAI411 05-020-411 Analog Module
  • Attitude Gyro 1U367-232-2 Aircraft Instrument
  • Sigma-Tek 5000B-36 Attitude Gyro 23-501-06-16
  • Sigmatek HGT834-W Injection Molding Teach Pendant
  • Sigma Tek 5000EG Attitude Gyro 1U670-003-12
  • Sigmatek HGT834-W Teach Pendant
  • Sigmatek DEE011 05-068-011 Module
  • Sigmatek DIAS DCP643 Central Processing Unit
  • Sigmatek MDD111-1 DIAS Drive Axis Module
  • Sigmatek DKL042 05-024-042 Terminal Module
  • Sigmatek DM822 Control Module
  • Sigmatek CDM167 12-008-167-O Module
  • Sigmatek TAE151 Touch Display Unit
  • Sigmatek DCC041 SLIDES Module 05-700-041-D
  • Sigmatek AKM65M-ANC2GBB0 PM Servo Motor
  • Sigmatek ETT221 01-230-221 Operator Terminal
  • Sigmatek SLIDES DAM 124 Analog Module
  • Sigmatek AKM31C-ANCNGBB0 Servo Motor
  • Mannesmann Demag Sigmatek CP626 Central Unit
  • SIGMATEK 0332.554.03 Board 371071000154
  • SIGMATEK 12-250-021 Base Plate Back Panel CM5V020
  • SIGMATEK DM162 S-DIAS Digital Mix Module
  • DEMAG ERGOTECH 061 381 66 Sigmatek 9842.243.02 Circuit Board
  • SIGMATEK CP313-1 PLC Module
  • Sigmatek ETV0551-2 VARAN Touch Terminal
  • Sigmatek SDM 081 FS S-Dias Safety Module
  • DEMAG 05-250-023 Ergotech Motherboard with Sigmatek TMS012
  • Sigmatek CM5V020 12-250-023-K Wiring Base
  • Sigma Tek 5000B-37 Attitude Gyro Indicator
  • Sigmatek SDD120-2 DIAS Drive
  • Sigmatek CME221 Memory Module
  • Sigmatek DCP640 DIAS Central Unit
  • Sigmatek STO040 Safety Output Module
  • Sigmatek CET281 Control Panel
  • Sigmatek CIPC LX800 Demag NC5 CPU
  • Sigmatek DKL093 05-024-093 Terminal Module
  • Sigmatek AI088 20-009-088 Analog Input Module
  • Sigmatek CAI888 Analog Input Module
  • SIGMATEK CCA021 12-025-021 Analog Output Module
  • SIGMATEK 1104.579.05 Control Module