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 | 820 次浏览: | 🔊 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) :

  • TDK-Lambda HWS1500-24 Industrial Power Supply
  • Land M2300/1100C-V Infrared Pyrometer
  • Lantronix 080-332-000-R Industrial Device Server
  • LED E14 3W Miniature LED Lamp
  • LEM LC100S/SP7 Hall Effect Current Sensor
  • Lenel LNL-1320 Dual Reader Interface Module
  • Lenze L5311 Industrial Control Module
  • Lenze EPZ-10203 Safety Controller
  • Lenze EPL10200 Industrial Drive Module
  • Lenze EPL-10200-XX Drive Controller
  • Lam Research 810-801237-021 Industrial Part
  • Lam Research 810-073479-215 Precision Part
  • Lam Research 853-001983-110 Assembly Data
  • Lam Research 810-017034-005 Semiconductor Part
  • Lambda LZS-A1500-3 AC-DC Power Module
  • Lambda LZS-1500-3 Industrial Power Supply
  • LAM 810-072907-005 Chamber Interface Control Module
  • LAM 810-068158-014 Semiconductor Process Control Module
  • LAM 810-800081-018 Vacuum System Interface Module
  • LAM 810-068158-013 Semiconductor Control Module
  • Leybold CM330 Vacuum Gauge Controller
  • Leybold 850-400-G1 Vacuum Pump Module
  • LIFTMASTER 71-1550B18LGH Electric Actuator
  • LKB Bromma 2211 Pressure Sensor
  • LLASERGAS AO2000 LS25 12944-E Gas Analyzer Module
  • Load Controls PH-3A Three-Phase Power Sensor
  • Ludlum 2401-P Pancake GM Survey Meter
  • LUST VF1410LHFS41 AC Servo Drive
  • LUTZE UBE-FL/34M Terminal Block Contact
  • Marposs E78 Dynamic Balancing Controller
  • LENZE E84AVSCE1534VX0 Servo Drive Controller
  • LENZE EVF8212-E Frequency Inverter Drive
  • LENZE EA-4/10 Drive Expansion Module
  • LENZE BG10 Brake Module
  • LEUZE DDLS 200/200.1-50-M12 Data Link Data
  • LEUZE DDLS 200/200.2-50-M12 Optical Data
  • LEYBOLD TURBOVAC 361 Turbomolecular Pump
  • LEYBOLD TR211 Vacuum Controller Data
  • LEYBOLD SV40BI Rotary Vane Pump Specifications
  • LEYBOLD PR25 Vacuum Pressure Sensor Data
  • MARPOSS E9066 Precision Measurement Control Unit
  • MATROX Y7116-04 REV A Industrial Vision Processing Board
  • MATROX Y7116-01 REV A Industrial Video Processing Board
  • MCS SA1000 Industrial Signal Amplifier Module
  • MECS CS-1000 Control System Hardware Data
  • MECS UTX1010 Industrial Control Module
  • MECS UTX-1000A Industrial Module
  • MECS UTV-F2500HA High-Power Thyristor Data
  • MECS EXT-2 Advanced Expansion Interface
  • MECS EXT-1 Interface Extension Module
  • MECS CPU-1000 Industrial PLC Controller
  • MEN A201SR04 Embedded Computer
  • MERAK 681H10078 681K10078 681K10079 Control Modules
  • Mercury Step C-663 Stepper Motor Controller
  • MERLIN GERIN MX+0F 26948 Shunt Trip Release
  • MERLIN GERIN 32570 Miniature Circuit Breaker
  • MERLIN GERIN 29329 High-Voltage Circuit Breaker
  • NEG2320-2 B5 Servo Drive Controller
  • METASYS NU-NCM350-8 Network Control Module
  • METRO MPS-4007 Signal Conditioning Module
  • METROSIL ZB9411015 Surge Protection Varistor Module
  • MEYER MEYER0909 1RR1337001 Industrial Control Module
  • MICRO MC2-440-10TVB-1-20 Industrial Switch Data
  • MICROSET 104988-E03 Control Card Data
  • MILLIPORE WGGB12S02 Water System Module
  • MILLIPORE CMHT-11S02 Chemical Process Sensor
  • MINI MAESTRO 60X7/14 Servo Drive Technical Data
  • MITRA PE3257/03 High Frequency Transformer
  • MEYER MEYER1009 1RR1337001 Industrial Control Component
  • MICRO MPB1-TP Industrial Interface Terminal Module
  • Mitsubishi GU-D04 GOT Serial Communication Board
  • Mitsubishi R28TB Robot Teaching Pendant
  • Mitsubishi A1S68DAV 8-Channel Analog Output Module
  • Mitsubishi A1S65B-S1 Expansion Base Unit
  • Mitsubishi A1SJ51T64 I/O Link Master Module
  • Mitsubishi HC-KFS23K-S49 AC Servo Motor
  • Mitsubishi ST1X4-DE1 4-Channel Digital Input Module
  • Mitsubishi QM100HY-H IGBT Power Module
  • Mitsubishi QM100HY-H IGBT Power Module
  • Mitsubishi QM100DY-H IGBT Power Module
  • Mitsubishi BN624A96IG52A MELSECNET/H Fiber Module
  • MITSUBISHI BN624A960H03B Control Module
  • MIYACHI MA-201C Welding Control Unit
  • MKS 223BD-00001AAB Pressure Transducer Data
  • Modicon AS-BADU-204 Analog Input Module Data
  • Modicon AS-S908-120 Remote I/O Processor
  • Modicon AS-J890-002 Remote I/O Interface
  • Modicon NW-BM85D002 Modbus Plus Bridge Manual
  • Modicon AS-B875-002 24VDC Input Module Data
  • MKS T3BIB-29916 Control Interface Board
  • MKS 683B-23795 Capacitance Manometer Pressure Sensor
  • Molex 85003-0567 DIN 41612 Connector
  • MOORE 750E1B2GNNNF Temperature Transmitter
  • MOORE 16147-51-2 ACM Transition Board
  • MOORE 16147-51-02 Signal Isolator
  • MOORE 16407-1-1 Industrial Power Module
  • MOORE 42-30 Smart Electro-Pneumatic Positioner
  • MOORE 16310-71-1 Industrial Control Module
  • MOTOMAN HW9381022 Welding Robot Arm
  • MOX MX603-2007-01 Industrial Control Module
  • MOXA EDS-408A-MM-SC Industrial Ethernet Switch
  • M-SYSTEM MD2202-D32-X-P Digital Input Module
  • MTL 8811-IO-DC Digital I/O Module
  • MTL 8604-FT-FU Field Terminal Specification
  • MTL 8104-AO-IP Analog Output Module
  • MTL 8103-AI-TX Analog Input Specifications
  • MTL 8505-BI-MB Bus Interface
  • MTL 8711-CA-NS Carrier Module Specification
  • MTL MTL5514D Intrinsically Safe Interface Module
  • MTL MTL4544AS Isolating Interface Module
  • MTL 8715-CA-BI HART Transparent Isolator
  • MTL831B Analog Multiplexer Transmitter
  • MTL 8502-BI-DP Profibus DP Interface Module
  • MTL838B-MBF Modbus Analog Multiplexer Receiver
  • MTL5053 Fieldbus Intrinsic Safety Barrier
  • MTL 8939-HN Fiber Optic Extender IOTA
  • MTL 8937-HN Dual-Channel Zener Barrier
  • MTL 5541 Repeater Power Supply Barrier
  • MTL 4073 Passive Intrinsic Safety Barrier
  • MTL5541 Galvanic Isolated Barrier
  • MTL 2213 Isolated Intrinsic Safety Barrier
  • MTS TBF120/12TS Servo Amplifier
  • MTS TBF120/7R Resolver Servo Amplifier
  • MULLER COAX MK32NC Coaxial Connector Module
  • MURATA DCC2223A 3EST125-977 Power Filter Module
  • MURR 857781 Industrial Interface Module
  • MYKROLIS FC-280SAV Gas Flow Control Module
  • Nabtesco BTC-304 Brake Controller