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 | 1024 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 SINUMERIK 840D SL NCU 720.3B with PLC 317-3 PN/DP
  • Siemens 6AV6618-7GD01-3AB0 HMI Panel
  • OMRON F150-C15E-3 Vision Mate Controller PLC Overview
  • Mitsubishi MELSEC A Series PLC System A63P A3ACPU A616AD A68RD3
  • M68-2000 2 Axis Motion Controller SCE SERVO CNC
  • OMRON FZ-S2M PLC Camera Vision System
  • VISOLUX SLVA-4K PLC Module from Elektronik GmbH
  • OMRON CJ1M-CPU23 V2.0 PLC CPU Unit
  • ABB AI86-16CHF PCB Card 5761751-9 B Specifications
  • Allen-Bradley 100-D140ZJ22L Contactor Overview
  • Merlin Gerin PB80 PLC Rack
  • WEIR WE203 Power Supply PLC
  • OMRON NX-TS3102 Temperature Input Unit
  • Siemens 6ES7146-6FF00-0AB0 I/O Module
  • Fanuc A16B-3300-0057 Circuit Board
  • OMRON CJ1W-IDP01 Input Module
  • Siemens 6FX2007-1AD13 Handheld Unit
  • Gems EM54 PLC Module PCB
  • Beckhoff CX2030-0121 Embedded PC CPU
  • OMRON NJ301-1100 Machine Automation Controller
  • Biesse Rover CNI PLC 2153 030 7146.30 Numerical Control Module
  • OMRON CJ1W DA08V Analog Output Module
  • OMRON CS1D ETN21D Ethernet Module
  • Allen Bradley 1768 L43 CompactLogix Controller
  • Schneider TWDLMDA40DTK Twido PLC Module
  • Mitsubishi NZ2EX2B 60AD4 Analog Input Module
  • OMRON NS8 TV00B V2 Touch Display Panel
  • Mitsubishi AY71 CMOS TTL Output Module
  • OMRON C500 CPU11 E Processor Module
  • OMRON CJ1W PTS51 Temperature Input Module
  • Siemens 6SL3100-1DE22-0AA1 600V DC Supply
  • OMRON CJ1M-CPU23 PLC CPU 9‑Pin Serial
  • Schlumberger IMT4N 24‑250VAC 48‑230VAC PLC Timer
  • OMRON CJ1M-CPU22 PLC CPU Unit V2.0
  • Allen‑Bradley 2711P-B7C6D2 Touch Screen PanelView
  • ADSP-2181KST-160 Analog Devices DSP IC Specs
  • Schneider LC1F400 400A Contactor Specifications
  • Yaskawa SGDH-10DE-OY 1kW 400V Servo Drive
  • Schneider TM262L10MESE8T M262 PLC 5ns Inst
  • Mitsubishi AA104VJ05 10.4in LCD Panel Specs
  • Allen Bradley 1761-L32BWA MicroLogix 1000 PLC
  • Siemens 6ES7431-7KF00-0AB0 Analog Input Module
  • Allen Bradley 1769-OB16 Output Module
  • Siemens 6ES7131-1BL12-0XB0 Input Module
  • Beckhoff EP7041-3002 EtherCAT Box Module
  • Siemens RK7243-2AA30-0XB0 Communication Module
  • Siemens 4AM5742-8DD40-0FA0 Transformer
  • Siemens 3TK2834-1BB40 Safety Relay
  • Brother BAS 311 Sewing Machine Circuit Board
  • Yaskawa SGDH-10DE-OY Servo Driver
  • OMRON C60H C6DR DE V1 Sysmac PLC
  • MITSUBISHI ELECTRIC A2ACPU21 S1 CPU Module
  • ABB BAILEY INNPM12 Network Process Module
  • HONEYWELL 620 0073C IPC PLC Module
  • Mitsubishi 15050 PR02B PLC Circuit Board
  • SIEMENS 6SY7000 0AC37 Drive Control Module
  • OMRON TJ2 ECT16 Traxial EtherCAT Controller
  • GE Fanuc IC698PSD300D Power Supply Module
  • Texas Instruments Series 505 16 Position Base
  • OMRON YASKAWA SGDH 10DE OY Servo Drive
  • Allen‑Bradley 440G-MT Safety Interlock Switch Specs
  • Rubycon PD27A 24V 8A Power Supply Module
  • SK-H1-GDB1-F11D PLC Gate Driver Board Kit
  • VIPA 441-4UA14 451-4UA14 PLC Module Rack
  • Mitsubishi FX5U-80MT ESS PLC Controller Specs
  • Mitsubishi Q64TCRTN Temperature PLC Module
  • GE 1C31170G Rev10 PLC Circuit Board Module
  • Schneider TWDLMDA40DTK PLC Controller Module
  • Omron FQM1-MMA22 Motion Control Module Specs
  • OMRON CJ1W-NCF71 Position Control Unit Specs
  • Schneider TSXETY4103 Ethernet Module
  • Mitsubishi Q12PHCPU Process CPU
  • Yaskawa 3G3HV-A4022-CE AC Drive
  • Cincinnati Milacron 3-533-0669G Temperature Control Board
  • Allen Bradley 20AC030A3AYNANC0 PowerFlex 70 Drive
  • Siemens 6ES7314-6BG03-0AB0 CPU 314C-2 DP
  • Carrier 17EX54007903 PLC Module
  • OMRON CS1W-V600C12 ID Controller Module
  • Honeywell 51402755-100 PCB Card
  • Heidenhain ECN 113 Rotary Encoder
  • OMRON B7AM-8B16 I/O Terminal Block
  • Fanuc A06B-6110-H026 Power Supply Module
  • Schneider TSXETG3021 Ethernet Gateway
  • OMRON CS1W-CLK21-V1 Controller Link Unit
  • NP1W6406T-Z704 PLC I/O Module
  • OMRON CJ1W-DA08C Analog Output Module
  • Yaskawa 3G3HV-A4022-CE AC Drive
  • OMRON NB7W-TW01B CP1L-EL20DR-D Power Panel
  • OMRON C500-NC103-E Position Control Unit
  • Steag Hamatech PLC DCS Servo Control System
  • Siemens 6SN1123-1AA00-0DA1 Power Supply Module
  • GE IC693CHS391H CPU & AD693CMM301A PLC Module
  • Siemens 6FC5303-0AF23-1AA1 PLC Control Panel
  • Square D CM4000T PowerLogic Circuit Monitor J1 F16
  • Siemens 6FX5002-5DG10-1BA0 MOTION-CONNECT 500 Cable
  • Schmersal SRB324ST 101195504 Safety Relay 24V
  • Mitsubishi 15050-PR02A PLC Circuit Board Module
  • OMRON CQM1-AD041 Analog Input PLC Module
  • Beckhoff EL5042 EtherCAT PLC Terminal Module
  • OMRON C200HW-MC402-E Motion Control Unit
  • C36TC0UA1100 Industrial Temperature Controller
  • NL8048BC24 12 Industrial Control LCD Module
  • OMRON R88D Servo Drive and Motor System
  • OMRON CS1W CLK21 V1 Controller Link Module
  • OMRON YASKAWA R7M A20030 S1 D Servo Motor
  • SIEMENS 6AV2128 3KB06 0AX1 Unified Comfort Panel
  • Schneider Electric METSEPM8240 PowerLogic Meter
  • Advanced AMCI 1PLC 1 31F Programmable Limit Switch
  • ABB PM582 ETH Programmable Logic Processor
  • SIEMENS 6FC5110 0CB01 0AA0 CPU Control Board
  • Schleicher P03GS13A CPU Module
  • Siemens 6SN1123-1AA00-0BA1 Power Module
  • Mitsubishi A1S61PN Power Supply Module
  • Yaskawa CPS-IONB DC Power Supply Module
  • Siemens 6ES7215-2BD00 CPU 215-2
  • Mitsubishi A2ACPU MELSEC PLC System Kit
  • ProSoft 3150-MCM Communication Module
  • Mitsubishi OSE104ET Incremental Encoder
  • OMRON CJ1W-AD081-V1 Analog Input Module
  • Broadcom BCM5464A1KRB Quad Port Ethernet IC
  • Modicon M221-24IO TM221C24 PLC 24 PNP Transistor
  • Allen-Bradley 1321-3R160-B Line Reactor 3R160B
  • Beckhoff CX1020-0012 Embedded PLC Module Specs
  • Turck BL20-PF-24VDC-D Power Feed Module Specs
  • Siemens 6SY7000-0AC37 Power Supply Module
  • Yaskawa SGDH-10DE-OY 1kW 400V Servo Drive Specs
  • Omron 3G3SV-BB015-E 1.5kW 220V VFD Specs
  • Uni-Pro CPU91-PLC J 23.020167X Processor Module