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 | 857 次浏览: | 🔊 Click to read aloud ❚❚ | 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) :

  • Laumas TLM8 Ethernet TCP/IP Load Cell Transmitter
  • Allen-Bradley 1771-NT2 Thermocouple Input Module
  • Siemens 6ES7135-0HF01-0XB0 Analog Output 4AO
  • Omron C60H-C6DR-DE-V1 Compact PLC
  • HMS Anybus AB7646-F Gateway Profibus to Profinet
  • Omron R7M-A10030-BS1 Servo Motor 100W Brake
  • Siemens 6SL3555-OPR01-0AA0 G110M Power Supply
  • Omron R88M-H10030-B AC Servo Motor 100W
  • Omron NJ301-1200 Sysmac NJ3 CPU EtherCAT
  • Toshiba H2218592 PLC Control Board Module
  • Omron R7A-CEA005S Servo Motor Encoder Cable 5M
  • TE.CO TFX 4G 1.5 Grey Cable
  • OMRON R88D-HT10 Servo Drive
  • OMRON CJ1G-CPU42H PLC CPU
  • MASS 106200 Industrial Monitor
  • OMRON CJ1W-AD041-V1 Analog Unit
  • Phoenix IBS PCI SC/I-T Board
  • OMRON ZFX-VS Vision Sensor
  • NAIS FP1-C72 PLC Controller
  • OMRON R88M-G75030H-BS2 Motor
  • SIEMENS A5E02625805-H2 PSU
  • Schweitzer SEL-2411 PAC Automation Controller
  • Siemens 5WG1-512-1AB11 Switching Actuator KNX
  • Stamford MX321-2 Automatic Voltage Regulator AVR
  • SCE M68-2000 Dual Axis CNC Servo Drive
  • ABB Bailey INNIS21 Network Interface Module
  • Omron CJ1W-F159 Loadcell Interface Module
  • GE Multilin MMII-PD-1-2-120 Motor Manager II
  • Yaskawa CIMR-VZ4A0018FAA VFD 5.5 7.5kW
  • Siemens 7SJ6001-5EA00-0DA0 Overcurrent Protection Relay
  • GE 531X300CCHAFM5 Drive Control PCB Board
  • Siemens 7SJ600 Overcurrent Protection Relay SIPROTEC
  • Siemens YSUW8 7683 C98043 A7002 Industrial PC Board
  • Omron 3G3MX2 A4055 E High Function Inverter Drive
  • Omron NB10W TW01B Interactive Display HMI Panel
  • Honeywell 30751044-008 Controller II ROM Board
  • Omron CJ1W IDP01 Combination Unit IO PLC
  • Omron C500 NC222 Position Control Unit PLC
  • Omron Z500 MC15E SW17R Vision System Controller
  • Sanyo Denki RS1A10AA RTA AC Servo Motor
  • Pilz PSS SB 3006 CN-A Compact Safety System PLC
  • OMRON C120-SI022 SYSMAC C120 Unit
  • SIEMENS 6SE9212-0DA40 MICROMASTER Inverter
  • ABB APBU-44C / APBU-44CE Branching Unit Kit
  • FANUC A20B-8100-0663 Mainboard
  • ABB 1SDA099907R1 Leakage Protection Relay
  • ABB IMMFP12 Multi-Function Module
  • OMRON CS1W-DA041 Analog Output Unit
  • Yaskawa SGMAS-08ACAHC61 Servo Motor
  • Benedetti 30.63/T090 3100MOT013_R1 Servo Motor
  • Omron C500-ASC02 ASCII Basic Unit Module
  • Yaskawa SGMGV-20DDL6F Servo Motor 1.8kW
  • ABB OITF-01C 64437496 D Control Board
  • TE.CO TFX 4G 1.5 Industrial Grey Cable
  • SCE M68-2000 Servo Drive Dual Axis
  • Omron C60H-C6DR-DE-V1 CPU Module PLC
  • Siemens 6SL3210-1SE21-8UA0 PM340 Power Module
  • Siemens 6GK7443-1EX30-0XE0 CP 443-1 Communications Processor
  • Siemens 6SL3210-1KE21-7AP1 SINAMICS G120C Drive
  • Phoenix UMK-32 RM/MR-G24/1/PLC Active Module
  • Omron NS5 SQ00B V2 HMI Touch Screen Industrial Terminal
  • Schneider TSX17 20 Micro PLC AEG Programmable Controller
  • Omron Z4M T30V2 Z4M H30V Laser Displacement Sensor System
  • Yaskawa SGMPH 04AAA61D OY 400W Servo Motor
  • Yaskawa CP 9300MC AC Servo Drive Motion Controller
  • Merlin Gerin VIP37PT48 Protection Relay Power Management
  • Yaskawa SGDH 05AE Sigma II Servo Driver 0.5kW
  • Rieter D90 DSP Autoleveller PLC Drawframe Control
  • Saia PCD2 H114 Fast Counting Module Counter
  • Axiomatic C902 Motion Board PLC Controller
  • Omron C500-TU001 3G2A5-TU001 PLC Teaching Box
  • Saia PCD4.M110 PLC CPU Module Programmable Logic Controller
  • Yaskawa SGMPH-04AAA61D-OY Sigma-II AC Servo Motor 400W
  • Sumitomo Cyclo FAS35-119 Precision Cycloidal Gear Reducer
  • Omron IDSC-C1DR-A-E ID Controller PLC Unit
  • Omron F350-L100E OVL Image Processing Unit Vision System PLC
  • Omron CJ1W-F159 Load Cell Interface Weighing Module
  • Bticino MA250 T7314A250 Megatiker PLC Module
  • Mitsubishi AJ71QLP21G GI Fiber Optic Network Module
  • Omron R88D-HS10 Servo Drive DC Type
  • Omron FZ3-L355 Vision Sensor Controller
  • Omron C200H-CPU23-E CPU Unit PLC
  • Moeller UNIOP MI4-110-KG2 Text Display HMI
  • KEB COMBIVERT F5 07.F5.B1B-3B0A Inverter
  • Toshiba VFS15-4037PL-W Variable Frequency Drive
  • Omron CS1W-SCU31-V1 Serial Communication Unit
  • LSIS SV055iG5A-4 AC Drive 5.5kW
  • Omron CJ1W-F159 Loadcell Interface Unit
  • Omron CQM1-TC001 Temperature Control Module
  • Mitsubishi FX5-SF-MU4T5 Safety Module
  • Omron C1000H-CPU01-EV1 CPU Unit
  • Yaskawa SGDV-2R8A11A Servo Drive 400V
  • Omron 3G3HV-A4055-CUE VFD 5.5kW
  • Omron F160-C15E Vision Sensor Controller
  • Schneider ELAU PMC-2 Servo Drive 2.2kW
  • Omron CQM1-TC102 Temperature Control Unit
  • Omron CS1G-CPU65-EV1 CPU Unit CS1 Series
  • Omron CJ1H-CPU66H CPU Unit High Performance
  • Saia PCD4.H320 Analog Input Module
  • Omron NX-EIC202 EtherNet/IP Coupler Unit
  • Omron R88M-H75030 Servo Motor OMNUC Series 750W
  • Omron F500-VS Vision Sensor F500 Series Machine Vision
  • Omron R88S-H306G Power Unit for Servo Motor OMNUC Series
  • Banner Q45ULIU64ACR Ultrasonic Sensor Q45U Series Proximity Mode
  • Allen Bradley 1756-IRT8I RTD Thermocouple Input Module ControlLogix
  • Siemens Sinumerik 840D SL NCU 720.3B with PLC 317-3 PN DP
  • Kollmorgen SERVOSTAR J-06 Servo Drive Danaher Motion
  • Omron NX-ECC202 EtherCAT Coupler Unit NX Series
  • OMRON CS1W-SCU31-V1 Serial Unit
  • Beckhoff CX5020-0110 Embedded PC PLC
  • Omron CJ1M-CPU13-ETN CPU Unit Ethernet
  • Omron C60H-C1DR-DE-V1 PLC Controller
  • Omron CJ1W-PTS51 Thermocouple Input Unit
  • Omron CJ1W-DA021 Analog Output Module 2 Ch
  • Omron CS1W-MAD44 Analog I/O Module
  • Omron C500-PRW05-V1 PROM Writer
  • Omron CJ1G-CPU45H Loop Control CPU Unit
  • ABB PSTX570-600-70 Soft Starter 570A
  • PTF Electronic SCR W1Z Power Controller 1150mm
  • Omron C500-CT012 High Speed Counter Unit
  • NBC Electronics MOD.ES 3 Ton Load Cell
  • DeltaOmega XML2 0060 45 4 S A Servo
  • REM EC235 Counter Module
  • Motor Power SKA DDR 148.30.8.19 Torque Motor
  • Delta Tau 4-Axis Interface PLC
  • Yokogawa PC10020 AA00 L1Z002 Position Controller
  • OMRON C60H-C5DR-DE-V1 PLC
  • Burgess PCD4.H320 Motion Control PLC