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

  • B&R X20CM0985 PLC Module
  • Banner XS26-2DE 85064 Safety Controller
  • Siemens 3SK2122-1AA10 Safety Relay
  • HMS Anybus AB7646-F Gateway PROFIBUS EtherNet/IP
  • Siemens 6SN1118-0DM11-0AA0 SIMODRIVE 611 Card
  • Siemens C98043-A7001-L2-4 CUD1 Control Board
  • Stein Sohn E 083.1 PLC Rack Module 0010026-054100A
  • Allen Bradley 800H-2HA7P Push Button Station
  • Schneider BMXNRP0200 M340 PLC Module
  • KEPCO BOP 200-1M Bipolar Power Supply Amplifier
  • Mitsubishi Q2ASHCPU PLC Module with A1SX42 A1SY42 QC24-R2 A1SD75P2-S3
  • Siemens Siprotec 7SJ61 Overcurrent Protection
  • Keyence LJ-V7000 Controller Laser Profiler
  • Siemens 6EP3437-8SB00-0AY0 Power Supply 20A
  • Pasaban MC-2006 03 CAN Bus PLC Card
  • ETAS ES600.2 PLC Module Prototyping
  • ABB ACS800-01-0005-3+P901 Frequency Converter
  • Omron NX102-1100 PLC Module Machine Automation
  • Square D BMXCPS3500 PLC Power Supply Module
  • Allen-Bradley 96657704 Fiber Optic Converter 1771-AF
  • Corcom 20VK1 Power Line Filter
  • Novellus 2805-11407 PLC Rack Assembly
  • Sick RLY3-EMSS100 Safety Relay Module
  • Microchip PIC12F508-I/P Microcontroller
  • Fanuc A02B-0098-B511 Motherboard
  • Merlin Gerin PB80 PLC Rack Module
  • ABB Pluto S20 V2 CFS Safety PLC
  • Honeywell TK-PRR021 Redundancy Module
  • B&R 7XX419L.50-1 Bus Controller
  • Mitsubishi NV400-SW 3P 300A Breaker
  • B&R X20AT2222 Temperature Module
  • Corcom 20VK1 EMI RFI Filter
  • Novellus 2805-11407 PLC Rack Assy
  • Mitsubishi FXAOM01BD Analog Output Module 4CH
  • NORIS A1-91 PCB Rack Module A1-91-4 A1-91-5 A1-91-6 A1-91-7 A1-91-8
  • Omron ZFV-SC50 Smart Camera Vision Sensor
  • Schneider Electric EOCR-PMZ Motor Protection Relay
  • B&R X20 SO 6300 PLC Module Safety Output
  • Mitsubishi A2ACPU21-S1 CPU Module MELSEC
  • Siemens 6ES7405-0KA02-0AA0 PS405 10A Power Supply
  • Samsung PVU-2424 Power Supply Unit DC24V 24W
  • ATTO controlSYS ATT0-CPU44 PLC with Display
  • Lenze EPZ-10203 CANPT010W3E Absolute Encoder
  • GE IS215WEMAH1A+IS210BPPBH2CAA Mark VIe Embedded Processor and Backplane Power Distribution Board
  • GE IS215AEPAH1CH+IS210BPPBH2CAA Mark VIe Application Processor and Backplane Power Distribution Board
  • GE IS215WECAH1B+IS210BPPBH2CAA Mark VIe Control Platform
  • GE PCM Regulator for EX2100e Power Conversion Module 151X1235DB15SA1
  • Lenze ECSEA048C4B servo drive
  • ABB PM665 3BDS005799R1 redundant CPU module
  • BAUMULLER b maXX 3000 Servo Controller BM3401-LIFBO-ACOOOCB-G-02-O-02
  • R&S EPL10200-W EMI Test Receiver
  • Schneider M522220000 16 way relay output module
  • ABB 3HAC031851-001 SMB Unit Technical Manual
  • Fuji NB1U56X-01 Programmable Controller Guide
  • Siemens 6AG1153-2BA02-7XB0 SIPLUS IM 153-2 Manual
  • Beckhoff EL6631 PROFINET Terminal Manual
  • Lenze E82EV302-4C Frequency Inverter Manual
  • Siemens 6SE7038-6EK84-1JC2 IGD8 Board Specifications
  • Pilz 774595 Safety Relay Specifications
  • Fanuc A20B-8200-0847 PLC Board Specification
  • Allen Bradley 1785-L60B/E PLC CPU Manual
  • PASABAN MC-2006 03 PLC Card Specifications
  • B&R X20CP1382 PLC Control Module X20 CPU
  • B&R X20DC2395 PLC Module Digital Output
  • AS-2P-70M-B Industrial PLC Communication Cable 70M
  • Siemens 6ES7136-6BA00-0CA0 PLC Module ET 200SP
  • Siemens 1FK7083-5AF71-1EB3 Servo Motor SIMOTICS S
  • WAGO 750 Series I/O Modules 750-842 750-530 750-430 750-602 750-514 750-600
  • Microchip TC9401CPD F/V Converter 100kHz 14DIP
  • Mitsubishi GT2310-VTBA GT2310-VTBD HMI Touch Screen 10.4 Inch
  • Siemens 3RT2036-1AN20 AC Contactor SIRIUS
  • Mitsubishi GT2708 HMI Touch Screen GT2708-VTBA VTBD STBA STBD
  • Siemens 6FC5110-0CB01-0AA0 CNC PLC CPU
  • ABB SINT4130C PCB Board
  • Omron NX1P2-1040DT PLC Controller
  • Fuji FRN3.7C1S-2J VFD
  • PLC-60/75 /E2UK Shielded Braided Cable
  • Omron CJ1W-NC434 Position Control Unit
  • Omron NX-AD2208 Analog Input Module
  • PASABAN MC-2006 03 PLC Card
  • Schneider 9038CR34 Pressure Switch
  • Pilz 240340 Safety Control Module
  • Mitsubishi A2NCPU Programmable Controller MELSEC
  • Mitsubishi Alpha XL Alarm Modem M20 Expansion
  • AutomationDirect D0-06DD2-D PLC DL06 Controller
  • Toshiba COMW01-21 PCB Control Board Turbine
  • Siemens 6FX1122-1AC02 Coupling Module SINUMERIK
  • Omron CVM1-CPU21-V2 CPU Unit Programmable
  • Beckhoff EL7041 Stepper Motor Terminal EtherCAT
  • B&R X20AI4622 Analog Input Module 4 Channels
  • OAT PMC25.2-003 Programmable Controller Module
  • Fanuc A16B-2200-0350 Graphic Board Series 16
  • Eaton Cutler Hammer 6-26-2 Contactor Contact Kit
  • Omron D4SL-NSK10-LK-K Safety Switch
  • Siemens C98043-A7001-L24 CUD1 Control Board
  • Mitsubishi A2NCPUR21-S1 PLC Module
  • National Instruments NI-9242 4-channel analog input module
  • BEMAC UST-202-D PLC Interface Board
  • Omron CJ1W-DA08C Analog Output Module
  • Mitsubishi QX521 CNC Interface Board
  • Schneider BMEP586040 High-Performance PLC Processor
  • Emerson 5X00875G01 Process Control PLC
  • Siemens SIMODRIVE 611 Power Module 6SN1145-1AA01-0AA0
  • Siemens 840C NC-CPU 486DX4 6FC5110-0BB04-0AA1
  • Mitsubishi GT2708 Series Operation Panel Touch HMI
  • Fanuc A04B-0103-C220 Programmable Controller Module
  • IFM CR2530 Programmable Controller for Mobile Automation
  • Omron FH-3050 Vision Controller i7-2715QE High Performance
  • National Instruments NI-9242 4-Ch Analog Input Module
  • B&R X20AI4632 Analog Input Module 4 Channels
  • Pilz 773600 Input Module Safety Automation
  • Panasonic AFPX-C60P Programmable Controller PLC
  • Siemens 6ES7414-2XL07-0AB0 S7-400 CPU Manual
  • Cutler Hammer WM34V Interlock Kit Manual
  • Pilz 777587 Safety Relay Specifications
  • Omron CJ2H-CPU64-EIP CPU Module Manual
  • B&R X20AI1744-3 Analog Input Module Guide
  • Schneider LC1G185BEEA Contactor Specification
  • Sharp LM64P101 LCD Screen Specifications
  • B&R X20AT4222 Temperature Module Guide
  • Mitsubishi A2UCPU-S1 Controller Specifications
  • Stein Sohn E 083.1 Rack Module Technical Guide
  • Omron CK3W-AX1515N Motion Controller
  • Schneider TSXP572634M PLC Processor
  • Epson RAIOC-33 Programmable Controller
  • GRID T&D iRTUe-D1R1-W.125 I/O Module
  • Fanuc A20B-2002-0520 Control Board
  • B&R X20IF1030 Interface Module