Welcome to the Industrial Automation website!

NameDescriptionContent
HONG  KANG
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)

来源: | 作者:佚名 | 发布时间 :2023-11-21 | 643 次浏览: | 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) :

  • Woodward 8237-1006 Digital Governor
  • WOODWARD 5501-471 Communication Module
  • WOODWARD 5466-258 Input/Output Module
  • WOODWARD 5501-467 Multi Protocol Communication Gateway and I/O Expansion Module
  • WOODWARD 5501-470 Digital microprocessor controller module
  • WOODWARD 9907-1200 Digital Governor
  • WOODWARD 8444-1067 High Performance Digital Microprocessor Controller Module
  • WOODWARD 8446-1019 Integrated Gas Engine Electronic Control System
  • WOODWARD 9907-162 Digital Engine Governor
  • WOODWARD 5466-316 Simulation Combination Module
  • WOODWARD 5464-414 Digital Speaker Sensor Module
  • XANTREX XFR40-70 DC power supply
  • XP POWER F8B6A4A6A6 power module
  • XP POWER F8B6D4A3G3 power supply
  • XYCOM XVME-674 VMEbus Single Slot CPU/Processor Module
  • XYCOM XVME-957 Circuit Board
  • XYCOM XVME-976 PC board computer
  • XYCOM XVME-530 8-Channel Isolated Analog Output Module
  • XYCOM Proto XVME-085 Bus Module
  • YAMAHA RCX40 4-AXIS ROBOT CONTROLLER
  • YAMATAKE EST0240Z05WBX00 touch screen display
  • YAMATAKE HD-CAOBS00 flowmeter
  • HIMA X-COM 01 Communication Module
  • HIMA HIMax X-AO 16 01 Analog Output Module
  • HIMA X-AI3251 Analog Input Module
  • HIMA X-DO3251 Digital Output Module
  • HIMA X-DI3202 Digital Input Module
  • HIMA X-DI6451 Digital Input Module
  • YASKAWA USAHEM-02-TE53 AC servo motor
  • Yaskawa JZNC-XPP02B Teaching Programmer
  • YASKAWA CACR-SR07BE12M servo drive
  • YASKAWA JAMSC-B2732V Advanced Drive Controller
  • YASKAWA JGSM-06 Controller
  • YASKAWA PCCF-H64MS 64MB Industrial Memory Module
  • YASKAWA CACR-02-TE1K servo driver
  • YASKAWA JAPMC-IQ2303 Controller Module
  • YASKAWA DDSCR-R84H Controller
  • YASKAWA JANCD-XTU01B circuit board
  • YASKAWA JANCD-XIO01 High Performance PC Input/Output (I/O) Board
  • YASKAWA JACP-317800 servo drive
  • XYCOM 120974 - Circuit Board
  • XYCOM 99298-200 - PC Control Card 99207A-001
  • XYCOM 99298-266 - CPU Board
  • XYCOM 99311-001 - Screen Display Ribbon Cable
  • XYCOM 99384-002 - PCB Module 99383A-001
  • XYCOM A05520I01 - Control Module PW22471 MPL400
  • XYCOM A33369 - Dual PMC Carrier Module
  • XYCOM AC2064A1 - VMEbus PCB Board Analog Output
  • XYCOM AC2065A1 - VMEbus PCB Board Analog Output
  • XYCOM CDA XVME - DSP SCSI I/O Module Serial RS232
  • XYCOM 143913-001 - TSKAM Board Rev A
  • XYCOM 1300-000100000 - Operator Interface Node Module
  • XYCOM 140050(R) - Documentation Support Library
  • XYCOM 1811-A00000000 - SXT1811T Monitor 100-120V
  • XYCOM 3112T-1200-256-2K - Operator Interface
  • XYCOM 3115 T - Industrial Computer
  • XYCOM 3406T - Flat Panel Industrial PC
  • XYCOM 3512-03F114003 - Automation Operator Interface
  • XYCOM 3515-A2P214003 - Operators Interface 6.3A
  • XYCOM 3535 - Operation Panel 3535-E3T434003
  • XYCOM 3612 T - LCD Flat Panel Display
  • XYCOM 3715 - Industrial Touchpanel Touchscreen PC
  • XYCOM 4115 T - Light-Duty Flat Panel 2000-512-2K
  • XYCOM 50151 - Automation Display
  • XYCOM 5017-T - Flat Panel Industrial Touch Monitor
  • XYCOM 3308T - 8" Flat Panel Color Touchscreen PC
  • XYCOM 9000-FFP-HU - Industrial Module
  • XYCOM 9440 - Automation HMI 9440-026714001
  • XYCOM 3406 KPT - Automation Control Panel
  • XYCOM 3000-CBL-25VP - Video Cable 25' 7.5M
  • XYCOM CA3-MBPALL-41 - Modbus Plus Module for GP2000
  • XYCOM QPI-MBP-XA1 - Modbus Plus Communication Module
  • XYCOM 3512 T - Automation Model HMI PM-101722C
  • XYCOM PM-102159 - Xycom Automation Monitor
  • XYCOM 3115T - Automation Panel
  • XYCOM PM3510T - Touch Screen HMI
  • XYCOM XA_WIN_2K_MUI - Recovery Media 2 Disks Kit
  • XYCOM XT1502T-CU17 - Viewtronix Flat Panel Touch Display
  • XYCOM XVME-9660 - VMEbus Module 779660
  • XYCOM 8000 KB3 Industrial Keyboard 97788-001
  • XYCOM 8000 KB5 Keyboard Front Panel Repair Evaluation
  • XYCOM 8100 0272A CNC Brown Out Sensor PROM Card
  • XYCOM 81600EA Control Card 82088-004/R
  • XYCOM 81625DA Control Board PC Board
  • XYCOM 81862 003R PCB Circuit Board
  • XYCOM 818662 003 N Pcb Circuit Board
  • XYCOM 81945F Control Card
  • XYCOM 81987 001 D General Purpose I/O 1805 Circuit Board
  • XYCOM 82029BC PCB Circuit Board 82027-001-F
  • XYCOM 82034CA Processor Module Board PC Computer Board
  • XYCOM 83017 002 PCB Circuit Board
  • XYCOM 83034CA Processor Module Board
  • XYCOM 83060C Processor Module Board
  • XYCOM 83060CA Processor Module Board
  • XYCOM 83194BA Terminal PC Board
  • XYCOM 83382CA Control Board
  • XYCOM 83594B Control Card w/ UNISON 675-0001
  • XYCOM 83594BD Control Card
  • XYCOM 84091A Connector Board 240276
  • XYCOM 8430 Industrial Controller 8430-044333800
  • XYCOM 8450 Industrial PC/AT Computer System LCD Monitor
  • XYCOM 8500 Operator Monitor 115/230V
  • XYCOM 86863BA Control Card 86864-003/B
  • XYCOM 86863BB Control Card
  • XYCOM 86863CC Control Card
  • XYCOM 87935 001 RacPac 8 Rack
  • XYCOM 89060B Circuit Board
  • XYCOM 89505 A Circuit Board
  • XYCOM 9000 EXF External Removable Floppy Disk Drive
  • XYCOM 9000 FFK Floppy Disk Drive for Industrial Panel
  • XYCOM 91195A - Circuit Board
  • XYCOM 91482 002 PLC Control Keyboard 4100 KB1
  • XYCOM 93533 001 Port 3 Port 4 Board Rev A
  • XYCOM 93886 003 4150A Model Operator Interface Panel
  • XYCOM 9400N Module 9400-400412001
  • XYCOM 9403 Operator Interface Panel CRT-Based PC
  • XYCOM 9403t Power Board
  • XYCOM 9407 17" CRT Industrial Monitor 1280x1024
  • XYCOM 9410 Industrial Mini PC Display Unit 9410-000302001
  • XYCOM 9450 044661401 Industrial PC 38-K42IMA-01
  • XYCOM 9450 248661601 Operator Panel 14" Color Monitor
  • XYCOM 9450 27B131901 HMI Panel Display
  • XYCOM 9457 023812001 Industrial PC Micro Vitec
  • XYCOM 9460 Operator Interface 51338-STN
  • XYCOM 9460 010304001 Operator Interface
  • XYCOM 9460-011223001 Operator Interface Panel
  • XYCOM 9460KP Operator Interface Panel Monitor Computer
  • XYCOM 9462-016304001 Operator Interface Panel