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

  • Fanuc A20B-8100-0137 PCB I O Board
  • D0-06DD2-D PLC Module DL06 PLC
  • Kepco BOP100-4M Power Supply Amplifier
  • Allen-Bradley 1785-L60B PLC-5 60 Module
  • Siemens 7MH4900-3AA01 Weighing Module
  • Pilz 773100 PNOZ m1p Safety Controller
  • Omron NS12-TS00B-V2 Graphic Operation Panel
  • EC20-4040BTA Programmable Controller PLC
  • Fanuc A16B-1212-0100-01 Power Unit CNC
  • Siemens 6ES7151-3BB23-0AB0 ET200S Interface Module
  • ATTO Control DU-01 PLC Display System
  • Keyence KV-RC8BXR Programmable Controller
  • Lenze GST04-1GVCK-063C22 Servo Motor
  • CKD AX9000GH AX9210H Control Unit
  • ABB PG6310 DC Trigger Control Board
  • Cutler Hammer 10316H621C Type L Device
  • TAIYO AA-277 EM CY TRIP PCB Card
  • Schneider BMXCPS2010 PLC Power Supply
  • Schneider TSXMRPC007M PLC PCMCIA Card
  • 101182218 Safety Stop Relay SSW301HV-230V
  • Cutler Hammer 9-1875-3 Size 6 Contactor 480V
  • Nidec UNI3401 Drive Module Control Board
  • Delta AS06XA-A PLC Module Analog Mixed IO
  • Lenze EPL 10201 13408978 Servo Drive 24V DC
  • Sigmatek CCP612-K PLC Module DI DO Module
  • Schneider ATS48D38Q Soft Starter Altistart 48
  • Fanuc A20B-3300-0472 Main CPU Board Series 30i
  • Mitsubishi A171SCPU-S3 Servo CPU Module PLC
  • ABB 1SFL597001R7011 700A 100-250V Soft Starter
  • Yaskawa JANCD-YCP21-E DX200 CPU Control Board
  • Schneider NS630N Circuit Breaker 3P 630A
  • Honeywell DPCB21010002 Rack Slot PCB
  • Mitsubishi RJ71EIP91 PLC Module
  • Siemens 3VL5763-1DC36-0AA0 Circuit Breaker
  • Siemens 6GK7542-1AX00-0XE0 Communication Module
  • Siemens 6SL3130-6AE15-0AB1 Smart Line Module
  • HMS Anybus AB7646-F Gateway
  • Honeywell 621-0020 Analog Input Module
  • Siemens 6ES7212-1HF40-0XB0 PLC Controller
  • MAK 1.00.7-36.21.00-40 PCB Module
  • ABB 3BSE006503R1 PFSA140 Power Supply
  • SAACKE F-GDSA 143303 Burner Controller
  • ABB PFSC230 25m Cable Set
  • GE HYDRAN 201Ci-1 Controller
  • ABB NINT-42C main circuit interface board
  • B&R 3AT660 6 Thermocouple Input Module
  • Honeywell EC7850A1080 Programmable Logic Controller
  • Mitsubishi A2ACPU21 CPU Module MELSEC A Series
  • Mitsubishi R60ADH3FR Analog Input Module iQ R
  • ELMO WLWHIA20 100 Servo Drive Whistle Series
  • Omron CJ1W-MAD42 Analog I O Module PLC
  • Siemens A5E03894525 SINAMICS S120 Power Module
  • Omron K3HB-HTA-DRT1 Temperature Panel Meter
  • Keyence KV-8000SO Programmable Controller CPU Unit
  • Harris 8800-00002-02 PLC Power Control Center
  • Siemens 3TY7480-0A Auxiliary Contact Block
  • Omron 3G3MX2-AB022-ZV1 Inverter
  • ABB ACS380-040S-12A6-4 VFD
  • ATTO controlSYS ATTO-CPU44 PLC System
  • Allen‑Bradley 5069-L330ERMS3 CompactLogix PLC
  • Emerson VE4003S2B2 Terminal Module
  • SND ATS48D38Q Soft Starter
  • Omron CJ1W-MCH71 Motion Control Module
  • Siemens 3TK28060BB4 24VDC Contactor
  • Mitsubishi FR-D740-160-NA Inverter
  • PILZ 312070 PSSuniversal PLC Head Module
  • Omron CJ2M-CPU35 SYSMAC CJ Series PLC CPU
  • KISTLER 4734AWDY2X400S1 Force Displacement Indicator
  • Beckhoff CX2100-0904 Power Supply UPS Module
  • Siemens 6ES7 194-4AD00-0AA0 ET 200PRO IM 154-1 DP Module
  • Siemens 6FC5110-0DB02-0AA2 SINUMERIK MMC CPU Module
  • EDWAR 3-SDDC2CF Dual Circuit Card Control Module
  • ABB CI856K01 S100 I O Communication Module
  • Omron C200HW-PCS01-V2 PC Card Unit Module
  • Pilz 777150 PZE X5P 24VDC Safety Relay
  • Siemens 6SE6430-2AD31-1CA0 Inverter
  • Pilz 774340 Safety Relay
  • Kübler 8.5868.1231.3112 Encoder
  • Stromag 51 NE 451 DV MS Switch
  • Mitsubishi Q20UDEHCPU CPU Unit
  • CON-MAL P86402251-00 PCB Board
  • Panasonic MDMA102A1D Servo Motor
  • Omron OS32C-SN-4M Safety Scanner
  • Mitsubishi LD-30FTA Tension Controller
  • Siemens 7SP8014 Genop 23 S Relay
  • GE 151X1235DB15SA01 SPEEDTRONIC Mark VI High Performance Turbine Control Module
  • GE DS3800HIOC High-Level Input Output Board
  • GE DS3800NHVG High-Voltage Gate Driver Board
  • GE DS3800NB1A Power Supply Regulator Board
  • GE DS3815PAHB1A1A Processor Interface Board
  • Allen-Bradley 100-D300EA11 IEC Contactor 300A
  • Omron BY50S 500VA 300W Uninterruptible Power Supply
  • Mitsubishi NF630-CW 3P 600A Molded Case Circuit Breaker
  • CLA-2 4L PLC Control Electric Lubricating Oil Pump
  • Pilz 6Z000002 PSEN enc sincos 4096 hs Encoder
  • Siemens 6ES7317-2FK14-0AB0 CPU 317F-2PN/DP
  • Fuji NP1AYH8V-MR Analog Output Module MICREX-SX
  • Kistler DMF-P A300 NCF 4734AWDY2X400S1 Force Displacement Monitor
  • ABB Pluto S20 v2 CFS Safety PLC
  • Parker IQAN-XS2 Expansion Controller Module
  • ABB CI867AK01 PLC Module
  • FANUC A20B-2002-0520 Main Board
  • Mitsubishi A6BR10 Repeater Module
  • Siemens 3TY6480-0A Contact Kit
  • Servax CDD34.008 Servo Drive
  • Renesas R5F2134CXJFP Microcontroller
  • Siemens 6SL3210-1SE31-0AA0 Power Module
  • Mitsubishi LE-40MTA-E Tension Controller
  • B&R 4PP035.0300-01 Operation Panel
  • HRTL 96B M666.01S-S12 Inductive Proximity Sensor
  • Mitsubishi GT1455HS-QTBDE GOT1000 Touch Screen
  • Braids PLC-24/30/E2UK 25m PLC Connection Cable
  • Omron NX-PD7001 NX Series Power Supply Unit
  • Pro-face FP3900-T41-U PFXFP3900TA Operating Panel
  • Siemens 6GK5204-2BB10-2AA3 Industrial Ethernet Switch
  • Mitsubishi GT2310-VTBA GT2310-VTBD Graphic Operation Panel
  • PILZ 774400 PNOZ 24VDC 2NO 2NC Safety Relay
  • Siemens 6ES7315-2EH14-0AB0 CPU 315-2 PN/DP
  • ABB PLUTO B42 AS-i Safety Relay 2TLA020070R1400
  • Applied Materials 0010-12123 PLC Controller
  • Pilz 774595 PZE X5 Safety Relay
  • Siemens 6GA2 490-0A AVR
  • Keyence KV-10T Micro PLC
  • Siemens 6ES7331-7PF01-0AB0 Analog Input
  • Siemens 6SN1145-1BA02-0CA1 PLC
  • FANUC A16B-3200-0521 Main Board
  • Siemens 6SL3120-2TE21-0AD0 Motor Module
  • Pilz 828010 S1IM Safety Relay