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

  • ETEL DSB2P131 & DSO-CAN111A Servo Amplifier Set
  • ETEL DSA2S211ZA-018A Digital Servo Amplifier
  • ETEL DSMAX212-111-001 568540-01 DSMAX2 Servo Controller
  • ETEL TMB+0291-150 Torque Motor Stator Assembly
  • ETEL EA-S0M-300-40/80A AccurET PSU
  • ETEL DSO-PWR112C-000B Power Supply Module
  • ETEL DSC2P141-111-000 Linear Servo Amplifier
  • ETEL DSB2S154-211-000H Servo Amplifier
  • ETEL DSCDP121-122-000 Digital Controller
  • ETEL DSCDP121-111E-000A Dual Position Controller
  • ETEL DSCDM332-111-000 Linear Servo Controller
  • ETEL DSB2P134-111E-000H Servo Amplifier
  • ETEL DSCDP132-111-000 Control Board Guide
  • ETEL DSB2S154-211E-000H Servo Amplifier
  • ETEL EA-SOM-300-40/80A Power Supply Module
  • ETEL ILM12-060-3PD-R20C Linear Motor with IWM Ways
  • ETEL P2M-300-07 AccurET Position Controller
  • ETEL DSB2P124-111E-000H Servo Amplifier
  • ETEL EA-P2M-048-05/10A Position Controller
  • ETEL EA-S0M-300-40/80A Power Supply Module
  • ETEL MWA070-0256-20B Linear Motor Magnet Guide
  • ETEL MWD070‑0128‑21A Linear Motor – Compact Ironless Linear Motor for High‑Speed Precision
  • ETEL DSB2P124‑211E‑000H Digital Servo Amplifier – 300 VDC Slave Drive for High‑Voltage Systems
  • ETEL MWD100‑0128‑00B Linear Motor – High‑Force Ironless Linear Motor for Precision Motion
  • ETEL AccurET EA‑S0M‑400 & P2M‑400‑05/10A Drive Module
  • ETEL EA‑S0M‑400‑40/80A‑0000‑00 AccurET Power Supply – High‑Power DC Supply for Motion Systems
  • ETEL MWA050‑0128‑20B Linear Motor Magnet – High‑Force Magnet Assembly for Linear Motors
  • ETEL DSB2S121‑111E‑000H Digital Servo Amplifier – High‑Current Drive for Demanding Motion
  • ETEL DSCDM332‑111C‑000B Digital Position Controller DSCDM – High‑Density Motion Module
  • ETEL EA‑P2M‑048‑2.5/5A‑0100‑01 AccurET Modular Position Controller
  • ETEL DSC2P121-111E-001A Digital Servo Controller – High‑Precision Motion Control
  • ETEL MWA050-0128-20B Linear Motor Magnet
  • ETEL DSB2P142-111E-000H Drive Specs
  • ETEL DSB2S234-111E-000H Servo Amplifier
  • ETEL EA-P2A-400-10-20A Position Controller
  • ETEL DSB2 Digital Servo Amplifier Controller DSB2P142-111E-000H SN 014661437
  • ETEL EA-S0M-400-40/80A-0000-00 AccurET Power Supply Module 650140-01
  • ETEL DSB2P131-111E-000H Servo Amplifier
  • ETEL EA-P2M-400-10/20A AccurET Controller
  • ETEL DSDP324-322F-000C Dual Motor Driver
  • ETEL DSB2S154-211E-000H Digital Servo Amplifier Drive
  • ETEL DSO-PWS111B-000C Power Supply Board 1130E-070-018
  • ETEL DSCDP324-322G-000A Servo Amplifier
  • ETEL DSB2P142-111E-000H Servo Amplifier Drive
  • ETEL EA-P2M-400-15/40A & EA-S0M-400 Drive Set
  • ETEL DSB2P142-111E-000H Digital Servo Amplifier
  • ETEL LMG15-070-3QC-H11 Linear Motor
  • ETEL TMA0140-070-3RB-S62B Torque Motor
  • ETEL DSA2S211ZA Digital Servo Amplifier
  • ETEL AccurET EA-P2M-300-4/7.5A-0100-01 Modular Position Controller
  • ETEL DSCDL332-131C-000A Servo Control Board
  • ETEL DSCDP324-322F-000C Dual Motor Driver
  • ETEL EA-P2M-400-10/20A Position Controller
  • ETEL DSC2P121 and DSO-HIO33 Servo Amplifier Set
  • ETEL EA-P2M-400-15/40A AccurET Drive
  • ETEL EA-P2M-300-07/15A Position Controller
  • ETEL EA-P2M-048-05/10A-0100-01 Servo Drive
  • ETEL EA-S0M-300-40/80A Servo Drive Guide
  • ETEL DSB2P131-111E-000H Digital Servo Amplifier
  • ETEL DSCDP334-421-000 Servo Drive Guide
  • ETEL EA-S0M-300-40 80A-0000-00 Motion Control Module
  • ETEL UltimET Light Motion Controller EU-LGP-0-0-1000-01 Multi-Axis
  • ETEL DSO-RAC601-029 Controller Rack
  • ETEL DSMAX212-121C-000C Board
  • ETEL DSCDL132-212B-000C Position Controller
  • ETEL TMB0291-050-3TDS-E82 Torque Motor
  • ETEL DSMAX212-121-000 Board
  • ETEL DSB2P131-111E-000H Digital Servo Controller Amplifier Unit
  • ETEL DSB 2S 124-211E-000H Digital Servo Amplifier
  • ETEL AccurET EA-P2M-300-4/7.5A-0100-01 Modular Position Controller
  • Beckwith Electric M-6280A Digital Capacitor Bank Control
  • Beckwith M-2355B Adapter Panel with M-2001C-6SL Tapchanger Control
  • Beckwith M-0359 Syncrocloser MOD512
  • Beckwith Electric M-2001C-6ELFA Tap Changer Controller
  • Beckwith M-3311A 4-Coil Transformer Protection Relay
  • Beckwith M-0124 Terminal Board Adapter Plate Guide
  • Beckwith Pride M-0296C 3-Phase Programmable Relay
  • Beckwith M-0388 Syncrocloser Check Relay Guide
  • Beckwith M-0170A AC Current Relay Guide
  • Beckwith M-3311 Transformer Protection Relay Guide
  • Beckwith Electric M3310 Integrated Transformer Protection Panel
  • Beckwith M-0145 First Customer Protector
  • Beckwith M-0170A AC Current Relay
  • Beckwith PRIDE M-0296C 3 Phase Programmable Relay
  • Beckwith Pride M-0296b 3-Phase Programmable Relay
  • Beckwith M-0245C High Speed Sync-Check Relay Guide
  • Beckwith M-0115A AC Parallel Balancing Module
  • Beckwith M-0389 Voltage Verifier Relay
  • Beckwith M-0115A Parallel Balancing Module
  • Beckwith M-0389 Voltage Verifier
  • Beckwith PRIDE M-0420 Multifunction Relay Protection Module 48VDC
  • Beckwith Electric M-3430 Generator Protection Relay
  • Beckwith Electric M-0067E Tapchanger Control
  • Beckwith Electric M-0420 Multifunction Relay
  • Beckwith Electric M-2001D-6L4S20C0S0X Tap Changer Control
  • Beckwith Electric M3425A-STD1 Generator Protection Relay
  • Beckwith Electric M-0245C High Speed Sync-Check Relay
  • Beckwith Electric M-3520 Intertie Protection Relay Guide
  • Beckwith Electric M-2001C-6SL Tap Changer Control
  • Beckwith Electric M-2001C Tap Changer Control Guide
  • Beckwith 35-12-635 Generator Protection Keypad Interface
  • Beckwith Electric P-2216 Generator Protection Main Board
  • Beckwith Electric M-2293 Tap Changer Control Guide
  • Beckwith M-4272-6AB1EH0 Integrated Synchronizing Motor Bus Transfer
  • Beckwith Electric M-4272 Motor Bus Transfer 60-140V 50/60Hz
  • Beckwith Electric M-2001B TapChanger Control
  • Beckwith Electric M-0193B Synchrocloser Unit
  • Beckwith Electric M-0115A AC Parallel Balancing Module
  • Beckwith Electric M-0169A Current Transformer
  • Beckwith Electric P-1939 Generator Protection Annunciator Panel
  • Beckwith Electric M-3311A Transformer Protection Relay Guide
  • Beckwith Electric M-0245B High Speed Sync-Check Relay
  • Beckwith Electric M3420 Generator Protection Relay
  • Beckwith M-0193B Syncrocloser Unit
  • Beckwith Electric M-520 Intertie Protection Relay
  • Beckwith Electric M-3425A Generator Protection Relay
  • Beckwith M-3425 Integrated Generator Protection Relay
  • Beckwith M-0115A Parallel Balancing Module
  • Beckwith Electric M-4272 Integrated Synchronizing Motor Bus Transfer
  • Beckwith Electric M-3420 Generator Protection System
  • Beckwith M-0193 Syncrocloser Unit
  • Basler Electric DECS-250-CN1SN1N Digital Excitation Control System
  • Basler Electric BE1-700 E0N2X1N Digital Protective Relay
  • Basler Electric SR4A-2B15B3A Static Voltage Regulator 120VAC 50/60Hz
  • Basler Electric 9261402111 PCB Control Board 9346000033
  • Basler Electric BE28053-002 Transformer BE28053002
  • Basler Electric BE3-25A Auto Synchronizer B1D Sync Module
  • Basler Electric BE3-GPR Generator Protective Relay