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

  • ABB DSCS131 57310001-LM DS Communication Board
  • ABB DSBC172 57310001-KD BUS REPEATER
  • ABB DSRF180A 57310255-AV Digital Remote I/O Module
  • ABB DSTC175 57310001-KN Precision Control Module
  • ABB DSSB140 48980001-P Battery Unit Industrial Control Module
  • ABB UAC389AE02 HIEE300888R0002 PCB Board
  • ABB PFTL101B 20KN 3BSE004203R1 DCS Module
  • ABB UFC718AE101 HIEE300936R0101 PCB Circuit Board
  • ABB UNS2880b-P,V2 3BHE014967R0002 Control Board
  • ABB UNS0887A-P 3BHE008128R0001 Communication Module
  • ABB UNS2882A-P,V1 3BHE003855R0001 EGC Board
  • ABB UNS2882A 3BHE003855R0001 Interface Board
  • ABB UNS4881b,V4 3BHE009949R0004 Controller
  • ABB 216EA62 1MRB150083R1/F 1MRB178066R1/F 216EA62 Redundant system modules
  • ABB 216DB61 HESG324063R100/J Controller Module
  • ABB PFSK142 3BSE006505R1 Control board
  • ABB DSAI133A 3BSE018290R1 Analog Input Module
  • ABB PFTL201C-10KN 3BSE007913R0010 Load Cells
  • ABB CI858-1 3BSE018137R1 Industrial Module
  • ABB 5SHY35L4520 5SXE10-0181 AC10272001R0101 Controller
  • ABB TU847 3BSE022462R1 Module Termination Unit
  • ABB 6231BP10910 PLC Analog Output Module
  • ABB 07BR61R1 GJV3074376R1 Distributed I / O Coupler
  • ABB DI93A HESG440355R3 Digital Input Module
  • ABB IC660BBA104 6231BP10910 Industrial Control Module
  • ABB TP858 3BSE018138R1 Module Controller
  • ABB PFEA111-65 3BSE050090R65 Tension Electronics Module
  • ABB DSMB-02C 3AFE64666606 Power Supply Board
  • ABB MC91 HESG440588R4 HESG112714/B Wireless Router Modules
  • ABB PPD113-B03-23-111615 Excitation system controller
  • ABB AB91-1 HESG437479R1 HESG437899 Graphics Expansion Module
  • ABB IT94-3 HESG440310R2 HESG112699/B controller
  • ABB NF93A-2 HESG440280R2 HESG323662R1/HESG216665/K Module Controller
  • ABB IW93-2 HESG440356R1 HESG216678/B I/O module
  • ABB PM861K01 3BSE018105R1 Processor Module
  • ABB RB520 Dummy Module For Submodule Slot
  • ABB SR511 3BSE000863R1 SR511 Regulator 24V/5V
  • ABB DSDP140B 57160001-ACX Counter Board
  • ABB T-1521Z High-Performance Industrial Controller
  • ABB R-2521Z Industrial Control Module
  • ABB COM0002 Industrial Communication Module
  • ABB TAS.580.0550G00 Industrial Controller Module
  • ABB TAS.580.0560G00 Industrial Controller Module
  • ABB SPAJ110C Earth-fault relay
  • ABB TP858 3BSE018138R1 Industrial Control Module
  • ABB SD821 3BSC610037R1 Digital Controller
  • ABB 128877-103 High Precision Industrial Control Module
  • ABB CI853-1 communication interface module
  • ABB PM861K01 3BSE018105R1 Processor Module
  • ABB 5SDF1045H0002 IGBT Silicon Controlled Rectifier
  • ABB TC512V1 3BSE018059R1 Bus Module
  • ABB UCD240A101 Industrial Controller Module
  • ABB TC820-1 Industrial Control Module
  • ABB PM820-2 PLC Pulse Counter Module
  • ABB PM820-1 3BSE010797R1 Processor Module
  • ABB TP830 Industrial Automation Control Module
  • ABB 3ASC25H705/7 control module
  • ABB UAD154A Industrial Automation Module
  • ABB PPD113B01-10-150000 3BHE023784R1023 Controller Module
  • ABB UNS2880B-P V1 Digital I/O Module
  • ABB PFEA112-20 3BSE050091R20 Tension Control amplifier
  • ABB CI810B 3BSE020520R1 AF 100 Fieldbus Communication
  • ABB PPC380AE02 Industrial Control Module
  • ABB NU8976A99 Digital Input Module
  • ABB REF615 Feeder Protection and Control
  • ABB CPU0002 High-Performance Industrial Controller
  • ABB M063B High Performance Control Module
  • ABB XO08R1-B4.0 EXTENSION OUTPUT MODULE
  • ABB VA-MC15-05 Industrial Control Module
  • ABB VA-3180-10 Industrial Controller
  • ABB 72395-4-0399123 High-Performance Industrial Control Module
  • ABB 83SR04C-E Hydraulic Servo Module
  • ABB DTDX991A Digital I/O Module
  • ABB DTCC901B High-Performance Digital Temperature Control
  • ABB UAD206A101 Controller Module
  • ABB UCD224A102 Control Module
  • ABB SNAT602TAC Interface Board
  • ABB UCD224A103 Industrial Control Module
  • ABB PDD205A0121 Terminal Card Module
  • ABB UNS0119A-P V101 3BHE029153R0101 Digital Input Module
  • ABB 15.04.20.05 Control Module
  • ABB FPX86-9329-C High Performance Industrial Controller
  • ABB ARCOL 0346 Industrial Control Module
  • ABB ARCOL 0338 High-Performance Industrial Control Module
  • ABB ARCOL 0339 Industrial Frequency Converter
  • ABB 969-54 Control Module
  • ABB KUC720AE High-Performance Industrial Control Module
  • ABB 5360673-01 Power Supply Module
  • ABB PFCL201C 10KN Industrial Module
  • ABB REF610 Feeder Protection
  • ABB SK616001-A Industrial Controller Module
  • ABB BC25 Controller Module
  • ABB 3HAB8859-1/03A Industrial Control Module
  • ABB 3HAB9271-1/01B Robotic Control Interface Module
  • ABB 3HAC5498-1 High-Performance Control Module
  • ABB 3HAC5518-1 Industrial Control Module
  • ABB 3HAC5497-1 Industrial Control Module
  • ABB 3HAC7344-1 Mains line filter unit
  • ABB 3HAC7681-1 Process Interface Module
  • ABB 3HAC6428-1/04 high-performance control module
  • ABB 3HAC6157-1 Floppy sign/supply cable
  • ABB 3HAC10847-1 Ethernet on front,Harness
  • ABB 3HAC5566-1 Industrial Communication Bus Cable
  • ABB 3HAC9710-1 Heat exchanger unit
  • ABB IMFECI2 Industrial Control Module
  • ABB IMDS014 Digital Slave Output Module
  • ABB INIT03 Control Module
  • ABB 3HAC031683-004 Cable Teach Pendant 30m
  • ABB HAC319AEV1 High-Performance Control Module
  • ABB UFC092BE01 Binary input module
  • ABB DAPC100 3ASC25H203 Industrial Control Board
  • ABB 57160001-KX DSDO 131 Digital Output Unit
  • ABB 3HAC4776-1/1 Industrial Control Module
  • ABB DSTF610 terminal
  • ABB YB560100-EA S3 Industrial Control Module
  • ABB XO16N1-B20 XO16N1-C3.0 High-Performance Industrial Control Module
  • ABB TU804-1 Programmable Logic Controller (PLC) Module
  • ABB TU515 I/O terminal unit
  • ABB TK516 Connection Cable with Contacts
  • ABB SPCJ4D34-AA Industrial Ethernet I/O System Module
  • ABB SPAD346C Integrated Differential Relay
  • ABB 1SAM101904R0003 SK-11 Signal contact 1NO+1NC
  • ABB SE96920414 YPK112A Communication Module
  • ABB SC610 3BSE001552R1 Submodule Carrier
  • ABB SC513 PLC Analog Input Module
  • ABB SAFT110 Advanced Safety Termination Module
  • ABB RVC6-5A Control Module
  • ABB RB520 Linear Motion Controller Module