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

  • GE Fanuc VMIVME-5588 High-speed Reflective Memory Board
  • VMIC VMIVME-5565 Reflective Memory Board
  • VMIC VMIVME-2127 Voltage Source Digital Output Board
  • VMIC VMIVME 4512 Analog VME Process PCB Assembly
  • GE Fanuc VMIVME-3122-022 Analog I/O Module
  • VMIC VMIVME 5576 High Speed Fiberoptic Network Board
  • FANUC VMIVME-7452 VMEbus Analog I/O Board
  • FANUC VMIVME-2210 VMEbus Digital Output Board
  • FANUC VMIVME-7750-734000 VMEbus Single Board Computer
  • VMIC VMIVME 2210 VMEbus DO 28V Digital Output Board
  • VMIC VMIVME DR11W VMEbus DMA Interface Module
  • VMIC VMIVME-2536-200 5V Optically Coupled Digital I/O Board
  • VMIC VME-7754 VMIVMF7754-259000 VMEbus Control Card
  • VMIC 2170A VME Interface Board
  • GE VMIC PMC-5565PIORC-210000 Reflective Memory PMC Node Card
  • VMIC VMIVME-7750-750000 VME Single Board Computer
  • VMIC VMIVME-7751 VME Single Board Computer
  • VMIC 332-004512 Analog VME Process Board
  • VMIC VMIVME2528 VME Interface Board
  • FANUC VMIVME-2120 VME Bus Interface Board
  • FANUC VMIVME-2540 VME Bus Interface Board
  • FANUC VMIVME-3230 VME Bus Interface Board
  • FANUC VMIVME-4514 VME Bus Interface Board
  • ETEL DSB2S154-211E-000H Servo Amplifier
  • ETEL DSCQT112-111-000 Motion Control Module
  • ETEL LMG20-050-3QB-211A Servo Motor – High Torque Linear
  • ETEL EU-LCP-0-0-1000-01 Communication Card
  • ETEL DSA2P174ZA-033A Servo Amplifier Driver
  • ETEL EA-P2M-400-15/40A-0100-00 Servo Driver
  • ETEL DSC2P152-111-000 Servo Drive Amplifier
  • ETEL LMS15-050-3UA-209A Linear Motor
  • ETEL DSC2P152-111D-000A Controller
  • ETEL DSB2P131-111E-000B Digital Servo Amplifier Position Controller
  • ETEL DSO-PWR111C-000B Power Supply Module
  • ETEL DSCDP324-321F-000C Servo Driver
  • ETEL DSC2P152-111B-000D Controller
  • ETEL DSB2P142-111E-000H Circuit Board
  • ETEL LMG05-030-3QA-H01 Linear Motor
  • ETEL DSC2P152-111F-000A Controller
  • ETEL DSA2S211ZA Servo Drive
  • ETEL DSCDM332-112-000 Drive Module
  • ETEL DSCDP334-421-000 Digital Position Controller Servo Drive
  • ETEL EA-P2M-400-15/40A-0100-00 AccurET Servo Drive
  • ETEL TMA0140-050-3UB-202B Torque Motor
  • ETEL DSA1DL1D.PCB Servo Drive Board
  • ETEL DSA2DL 1A Servo Drive
  • ETEL DSMAX111B-000B Servo Drive
  • ETEL DSO-PWS111C-000B Power Supply Module
  • ETEL DSC2P142-111B-000D Servo Drive Amplifier
  • ETEL DSC2P132-111D-000A Servo Drive Amplifier
  • ETEL DSC2P152-111B-000D Servo Drive Amplifier
  • ETEL DSB2P131-121E-000H Servo Drive Amplifier
  • ETEL DSB2P142-111E-000H Servo Drive Amplifier
  • ETEL DSO-PWR112C-000A Power Supply Module – High Power
  • ETEL DSO-PWR111C-000A Power Supply Module
  • ETEL DSB2P121-121E-000H Servo Drive Amplifier
  • ETEL DSB2S134-111E-000H Digital Servo Amplifier
  • ETEL RTMA0140-070-AQN-21E Motor
  • ETEL DSCDP132-111-000 Dual Controller Circuit Board – Motion Control
  • ETEL LMS15-050-3UA-209Aft Linear Motor
  • ETEL DSCDP324-322G-000A Position Controller
  • ETEL DSA2P174ZA-033A Servo Amplifier Driver
  • ETEL DSA2P174ZA-017A Servo Amplifier Driver
  • ETEL LMD10-050-3QA-223A Linear Motor
  • ETEL EU-LGP-0-0-1000-00 PCI Network Card
  • ETEL DSO-PWS111C-000B Power Supply Module
  • ETEL DSC2V174-111C-001A Servo Controller
  • ETEL EA-P2M-600-15/40A-0000-01 AccurET Modular Position Controller
  • ETEL RTMA0140-070-AQN-21B DD Motor
  • ETEL DSC2P144-421-000 Servo Driver
  • ETEL EA-P2M-400-15-40A-0100-00 Servo Drive
  • ETEL DSCDM341-111C-000B Board
  • ETEL LMD10-050-3QA-223A Motor
  • ETEL RTMA0140-070-AQN-21E DD Motor
  • ETEL DSCDM342-111-000 Servo Variator
  • ETEL DSC2P152-111E-000A Servo Amplifier
  • ETEL LMS15-050-3UA-209A Motor
  • ETEL RTMA0140-070-AQN-21C DD Motor – High Torque Direct Drive
  • ETEL DSCDP334-421G-000A Servo Drive
  • Etel DSB2S154-211E-000H Digital Servo Amplifier
  • ETEL EA-P2M-400-15/40A-0100-00 AccurET Servo Drive
  • ETEL DSA2P-174ZA-017A Digital Servo Amplifier
  • ETEL EA-P2M-400-15/40A-0100-00 Servo Drive
  • ETEL LMP07-100-3TAS-229 Linear Motor Primary Part
  • ETEL LMA11-120-3ZA-359A Linear Motor
  • ETEL EA-S0M-400-40/80A-0000-00 Drive Power Supply
  • Etel DSCDP334-421-000 Driver
  • ETEL DSCDM341-111C-000B DSCDM Drive Board
  • Etel DSA1 Digital Servo Amplifier
  • ETEL DSA2P174ZA-033A Servo Amplifier
  • ETEL DSCDM342-111-000 Servo Verifier
  • ETEL LMS15-050-3UA-209A Linear Motor
  • ETEL P2M-048-2.5/5A AccurET Position Controller – Modular
  • ETEL LMD10-050-3QA-223A Linear Motor – Compact Precision
  • ETEL EA-P2M-400-05/10A-0000-01 Drive – Precision Motion
  • ETEL LMP07-100-3TAS-229 Linear Motor Primary Part
  • ETEL EU-LGP-0-0-0000-00 Motion Control Card – Precision Control
  • ETEL DSC2P152-111E-000A Servo Amplifier
  • ETEL EA-P2M-400-15/40A-0100-01 Servo Drive
  • ETEL EA-SOM-300-40/80A-0000-00 AccurET Power Supply Module
  • ETEL LMG10-1050-3QA-H01 Linear Motor
  • ETEL EA-SOM-300-40/80A-0000-00 AccurET Modular Power Supply
  • ETEL EA-P2M-400-15/40A-0100-00 AccurET Servo Drive
  • ETEL EA-P2M-400-15/40A-0100-01 Servo Driver
  • Etel RTMA0140-070-AQN-21B High Speed Motor
  • ETEL DSC2P141-111-000 Linear Servo Amplifier
  • ETEL DSB2S134-211E-000H Digital Servo Amplifier
  • ETEL 3LM-23C Motion Controller
  • Etel DSO-SER211-000 Power Add-On Board
  • ETEL DSCDP334-421-000 Servo Drive
  • CTI-Cryogenics 8116071G001 Enhanced On-Board 8F Cryopump
  • ETEL LMD10-050-3QA-223A Linear Motor
  • Etel DSO-SER211-000 Servo Card Power Add-On
  • ETEL LMG05-050-3QA-213A Linear Motor
  • Etel DSO-SER211-000 Power Add-On Board
  • ETEL EU-LGP-0-0-0000-00 Motion Control Card
  • ETEL EA-P2M-400-15/40A-0100-00 AccurET Servo Drive
  • ETEL DSA2P1540A Digital Servo Amplifier
  • ETEL DSC2P131-111-000 Drive Board
  • ETEL DSC2P131-111D-000A Servo Drive
  • Etel SA-IL 03-208 Linear Motor Section 208mm
  • ETEL EA-P2M-300-4/7.5A-0000-01 AccurET Position Controller
  • ETEL DSO-SER211-000 Power Board
  • ETEL DSC2P131-111F-000A Servo Amplifier
  • ETEL DSA1P6242B Digital Servo Amplifier
  • ETEL DSC2P131-111B-000B Regulator
  • ETEL DSA2P1540A Digital Servo Amplifier
  • ETEL EA-P2M-048-2.5/5A-0100-01 Drive