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

  • Sumitomo SHI Cyclo Drive F3CS-A25G-89 Reducer
  • Sumitomo KNR0827 Wiring Harness SH120-3 SH120A3
  • Sumitomo ULC100011-01 LNR Actuator Driver
  • LUBE GMN-10-200-CB2-7L Lubricator Grease Pump
  • Sumitomo SH65UJ Rubber Track
  • Sumitomo KHR69310 Excavator Monitor
  • Sumitomo FDT-2FS Fiber Identifier Power Meter
  • Sumitomo CNVMS-4085G-43 Ink Fountain Motor
  • Sumitomo GV9924023-38 Circuit Board
  • Sumitomo 407915-5510 4BG1TRA ECU Controller
  • Sumitomo Cyclo F71m/4 Induction Motor 0.37kW
  • Sumitomo ANFJ-K30-SV-9 Hydraulic Control Valve
  • Hitachi Sumitomo 4625051 Pilot Valve Joystick
  • Sumitomo Demag W4RAP 6 W7-04-30 Valve
  • Sumitomo RV F2CF-A35-119 Gearbox
  • Sumitomo SH120 Slew Ring JCB JS130
  • Sumitomo Truninger QT-42-20HS-A Gear Pump
  • Sumitomo D2X-00577/02 SLV Control Board
  • Sumitomo Type-36 ARC Fibre Fusion Splicer
  • Sumitomo WRX33000R125-300 Shell Milling Cutter
  • Sumitomo Fine Cyclo F4CS-C35-59 Gearbox
  • Sumitomo Demag 4WREE 10 W75-23 Flow Valve
  • Sumitomo RDK-408A3 MRI Cold Head 5445412
  • Sumitomo AF-500 AF502-1A5 Cold Head
  • Sumitomo TYPE-35SE Fiber Optic Fusion Splicer
  • Sumitomo SH60 Rubber Track
  • Sumitomo SXPL JA765811BE Controller Interface Display
  • Sumitomo RF4100R Shell Mill 6 Flute 1.25 inch Arbor 4 inch OD
  • Sumitomo SHI SA765621AX SA765587BC Control Module
  • Sumitomo P-022CD-1A Cold Head Drive Unit
  • Sumitomo NL6448AC33-18 JA762898AD Operator Panel
  • Sumitomo JA762870GC Populated Circuit Board
  • Sumitomo Type-37 SM MM Fusion Splicer
  • Steel Track Chain for Sumitomo SH75 Excavator
  • Sumitomo CNV-6095-6 Cyclo Drive
  • Sumitomo Fine Cyclo F4CS-C35-59 PB048860 GEB
  • Sumitomo TC-FXPA FB-2E Motor RNYM2-1520A-EP-B-60 Gearbox
  • Sumitomo Heavy Industries RDK-4XX MRI Cold Head
  • Sumitomo SA765523AX PMDRV PCB Card 7MBP50RA060
  • Sumitomo Drive 307H-25 119H2505 Speed Reducer
  • Sumitomo Eaton H-130AA2FXJ Orbit Motor
  • Sumitomo JA775810A3 Nozzle Heater 19-58 130W
  • Sumitomo ZNFM05 Gearbox
  • Sumitomo F1C-A25-119 Gearbox
  • Sumitomo Fusion Splicer Type 39BT
  • Sumitomo MC78 UMC78S000-01 Motion Controller
  • Sumitomo Cyclo 2 Speed Motor Brake Gearbox
  • Sumitomo Drive PA213763 RNYMS02-1320YC-40
  • Sumitomo JA450704A2 Cylinder Head
  • Sumitomo T39 Fusion Splicer
  • Sumitomo AF-500 Cold Head
  • Sumitomo 71C Fusion Splicer
  • Sumitomo RDK-408S Cryocooler Cold Head
  • Sumitomo L3 Coldhead
  • Sumitomo F2CS-A25-119 Gearhead
  • Sumitomo US60125-GA AC Servo Driver SS6000
  • Sumitomo Type 39 Fusion Splicer
  • Sumitomo ANFJ-K30-SV-9 Planetary Gearbox
  • Sumitomo Heavy Industries JA761557BC RSC86-I Control Board
  • Sumitomo SA765604AX SA765603BC SXEX Servo Control Board
  • Sumitomo SumiDrill WDX2250D3S150 Drill
  • Sumitomo Type-66M12 Mass Fusion Splicer
  • Sumitomo Heavy Industries JA761557AC RSC86-I Control Board
  • Sumitomo JA761015CC RSC86 Circuit Board
  • Sumitomo T-72M12 Mass Fusion Splicer
  • Sumitomo TYPE-72C-KIT Core Aligning Fusion Splicer
  • Sumitomo CI-10/600-ADSD1-2 Power Supply
  • Sumitomo HF5202-3A7 Electronic Module
  • Sumitomo JA761015EC RSC86 Servo Control Board
  • Sumitomo TYPE-39 DCM Micro Core Fusion Splicer
  • Sumitomo JA761070HC AP-M Circuit Board
  • Sumitomo TYPE-400S T-400S Fusion Splicer Kit
  • Sumitomo TYPE-201E-VS Quantum Fusion Splicer
  • Sumitomo MC78IO Drive Power Module
  • Sumitomo 3-Phase Motor Gearbox 4kW 241RPM
  • CASE KRC10510 Hydraulic Swing Motor Sumitomo
  • Sumitomo HF4302-011 HF-430 Inverter Drive 11kW
  • Sumitomo SA765654BC SXIO-B Control Board
  • Sumitomo SDPH-018CHB PWM Amplifier Module
  • Sumitomo JA761070JC AP-M Circuit Board
  • Sumitomo HV960LC Local Control Board
  • Sumitomo T-71C+ Fusion Splicer Camera Y Focus Error
  • Sumitomo CH-210 Cold Head Cryo Cooler
  • Sumitomo Type-71C+ DCM Fusion Splicer
  • Sumitomo Type-65M12 Ribbon Fiber Fusion Splicer
  • Sumitomo T-502S Elite Fusion Splicer
  • Sumitomo T-72C+ Fusion Splicer
  • Sumitomo JA767632AC Circuit Board
  • Sumitomo Type-72C+ Core Alignment Fusion Splicer
  • Sumitomo CP5003 101AGG01 Sequencer I/F Board
  • Sumitomo T-37SE Fibre Fusion Splicer
  • Sumitomo Type-71C-KIT-PLUS Fusion Splicer
  • Sumitomo Type-72C HD Fusion Splicer
  • Sumitomo Type-72C+ Fusion Splicer FC-6+
  • Sumitomo Type-65M12 Ribbon Fusion Splicer
  • Sumitomo Type-72C+ Fusion Splicer
  • Sumitomo Type-39 DCM Fusion Splicer
  • Sumitomo Z1C Core Alignment Fusion Splicer
  • Sumitomo Type-71C DCM Fusion Splicer
  • Sumitomo T-72M12 Ribbon Fusion Splicer
  • ABB SACO 64D4 Digital Annunciator Unit 64-Channel Alarm System
  • EMERSON FloBoss S600+ P154 PRV Board 7381540 Prover Module
  • EMERSON FloBoss S600+ P155 PSU Board 7161550 Power Supply
  • EMERSON FloBoss S600+ P153 Front Panel 7181530 Display Keypad
  • EMERSON FloBoss S600+ P148 Dual Pulse Mezzanine 7181483 Module
  • EMERSON FloBoss S600+ P144 I/O Board 7281440 Analog Digital Module
  • EMERSON FloBoss S600+ P152 CPU Board 7381520 Main Processor
  • EMERSON FloBoss S600+ Base Unit 8176003 Flow Computer Chassis
  • Lauer PCS100FZ XX1.1031.SHX PLC HMI Operator Panel
  • Lauer Weber PCS095.S PG 195.203.3 Operator Panel HMI
  • Lauer Pcs Light PG 080.308.E Operator Panel HMI Console
  • Lauer Pcs Light PG 080.308.E Operator Panel HMI
  • Lauer PCS590p Pg 59X.000.0 PROFIBUS-DP HMI Panel
  • Lauer PCS095.1 095.408.A Operator Panel HMI
  • Lauer PCS009.m 109.203.1 Operator Panel PCS009
  • Lauer Pcs Light PG 080.308.F PLC HMI Operator Panel
  • Lauer Pcs 095.s 195.203.3 Operator Panel – Industrial HMI
  • Lauer LCA 200 (200-V02093) Starline Mini Operator Terminal – Compact HMI
  • Lauer PCS 110FZ Operating Screen – Compact Industrial Display
  • Lauer LCA200 022/581 Operator Terminal – Industrial HMI Panel
  • Lauer AST-150A Front Cover with Touch – Replacement Bezel for Industrial Panels
  • Lauer PCS8010 035/28B Operator Panel – Industrial HMI
  • Lauer PCS260FZ Membrane Keyboard Replacement
  • Lauer PCS plus MPI PCS090.m Operator Console
  • Lauer PCS 806 EEPROM Memory Module
  • Lauer VPC S95e 410 Control Panel System Controller
  • Lauer PG095.507.A Operator Panel PCS095 HMI
  • Lauer PCS8010 035/28B Operator Panel HMI Console