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

  • Siemens 6SN1123-1AB00-0AA2 LT Module
  • A100005506 Compair Delcos 3100 Control Panel
  • Omron ZFV-CA40 Smart Sensor Amplifier
  • Fanuc A16B-2200-0660 I O Board
  • Omron CJ1W-NC471 Position Control Unit
  • Siemens 6SN1112-1AA00-0AA0 Simodrive PWM Module
  • Mitsubishi GT2708 HMI Touch Panel
  • Siemens 3TK2834-1BB40 Safety Switch
  • INSYS EBW-E100 Industrial Ethernet Router
  • Schneider LC1F400 Contactor TeSys F
  • Mitsui RYP-51 PCB Control Board
  • Tamagawa TS2620N941E172 Encoder
  • Pilz PZE 9 Safety Relay
  • Omron C1000H-CPU01-V1 PLC
  • Siemens 6SL3210-1KE21-3UP1 Frequency Converter
  • Allen-Bradley 440E-L22BNSM Rope Pull Switch
  • ABB CI868K01 Interface Module
  • Stein Sohn E 083.1 PLC Rack
  • Mitsubishi GT2508-VTBD GT2508-VTBA HMI
  • ABB 3BSE018161R1 Module
  • CAREL ASD100 PGD1AY0I00 Operation Panel
  • ABB EK370-40-11 Contactor 220-230V
  • Eaton 9PX1500IRTM UPS 1500VA
  • NCV-20NGNMP Programmable Controller
  • Mitsubishi LE-40MTA-E Tension Controller
  • Fanuc A16B-3200-0429 Control Board
  • Mitsubishi GT2310-VTBA HMI Touch Screen
  • 3A99184G 1C31170G PCB Module Rev 10
  • Schneider 140NOM25200 Modicon Quantum Adapter
  • Mitsubishi NV400-SW 400A Circuit Breaker
  • Applied Materials 0190-51102 Heater Controller
  • Omron C200H-DA003 Analog Output Module
  • Yaskawa JANCD-YCP21-E DX200 CPU Board
  • IAI 12G2-60-250-P-L-C1-SP Intelligent Actuator
  • NLT NL8060BC21-11 8.4 LCD Screen
  • Omron NX502-1300 Controller Unit
  • ABB RVT-6 Power Factor Controller
  • Schneider TM258LF66DT4L PLC Controller
  • NLT NL6448BC26-27D 8.4 LCD Panel
  • NLT NL8060BC21-09 8.4 LCD Screen
  • Keyence XG-8700L Multi-camera Imaging System
  • EPC 50 3183045486 I O Motherboard
  • Nidec Emerson M701-054-00270A CT Drive
  • Therma Wave 18-011040 Controller Assembly
  • Mitsubishi Q03UDECPU PLC CPU Module
  • Allen-Bradley 2002-NX70-MWLINK PLC Module
  • AS-2P-60M-B Industrial PLC Cable
  • Yaskawa JANCD-YCP21-E DX200 CPU Board
  • PASABAN MC-2006 03 CAN PLC Card
  • Mitsubishi RJ71PB91V PROFIBUS DP Module
  • 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