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

  • VMIC VMIVME 4512 Analog I/O Board – 332-004512-300
  • VMIC VMIVME 4120 VMEbus Circuit Board – 332-004120
  • VMIC VMIVME-3801-100C Analog-to-Digital Converter Module
  • IS215UCVEH2AE VME Controller Card
  • FANUC 333-00DMA0-000 VME Module
  • GE Fanuc VMIVME-5588-200 High-Speed Reflective Memory Card
  • VMIC VMIVME-7696-650 VMEbus Single-Board Computer
  • GE Fanuc VMIVME-5532S VMEbus Fiber-Optic Repeater Link
  • VMIC GE EV-DIO-01 Control Board
  • Abaco VMIVME-7751 Pentium III VME Single Board Computer
  • PMC-5565PIORC-110000 128MB Reflective Memory Card
  • Abaco VMIVME-5565-010000 Reflective Memory Board
  • VMIC VMIPMC-5565 Reflective Memory PMC Module
  • VMIC VMIVME 5504 Slave VME Module
  • VMIC VMIVME-5740-12000 VMEbus Hard Drive Module
  • VMIC VMIVME-7751 VMEbus Processor Module
  • VMIC VMIVME-7588 CPU Module
  • VMIC 332-000132 VMIVME PCB Card
  • GE Fanuc VMIVME-4514A Analog I/O Board
  • Abaco VMIVME-2528-000 128-Bit TTL Digital I/O
  • VMIC VMIVME 4514 Scanning Analog I/O Board
  • VMIPCI 5588-101 High Speed Fiber Optic Reflective Memory Card
  • VMIC VMIVME-1228 VMEbus Board
  • VMIC VMIVME-7455 CD-ROM Drive Module
  • VMIC VMIACC 0577 Compact PCI Board
  • IS415UCVGH1A VME Controller Card
  • VMICPMC-5664 VME PMC Dual Fiber Card
  • VMIVME1128 128-Bit High-Voltage Digital Output Board
  • VMIC VMIVME-2170A VMEbus PCB Board
  • VMIC 332-015565-010L VME Module
  • VMIC VMICPCI-7612-470 Single Board Computer
  • VMIC EV-CNT/01 Control Board
  • VMIC VMIVME 1181 VMEbus Input Board – 333-001181-000 A
  • VMIC VMIVME-1150 VMEbus Module
  • VMIC VMIVME-5576 VMEbus Module
  • VMIC VMIVME-4150 VMEbus Module
  • VMIC VMIOMAX-8001B PLC Rack
  • VMIC VMIVME 2128 High-Voltage Digital Output Board
  • VMIC VMIVME-1111 64-Bit High-Voltage Digital Input Board
  • GE Fanuc VMIVME 1182 VMEbus Input Board – 332-011182-060C
  • VMIC VMIVME-7696 VMEbus PC Board
  • VMIC VMIVME-7686 VMEbus Module
  • GE VMIVME-7486 VME PCB Board
  • VMIC VMIVME-7740-840 Processor Module
  • VMIC VMIACC BT01 REV 0 Transition Board
  • Abaco VMIPCI-5576-001 Fiber-Optic Reflective Memory Card
  • GE IS215UCVGH1A VME Controller Card
  • VMIVME 7671-421000 VME Module
  • VMIC FLKMD37SUBS Module
  • VMIC VMICPCI-7611-465 Single Board Computer
  • GE VMIC VMIPMC-6003 PMC Module – 302-000227-000
  • VMIC VMIVME 1330 VMEbus Circuit Board
  • GE Fanuc VMIVME 1182 VMEbus Input Board – 332-011182-001A
  • VMIVME-2534-111D 32-Bit High-Voltage Digital I/O – VMEbus
  • VMIC PCI-5565 Reflective Memory Card
  • VMIC VMIVME 6015 VMEbus Serial Interface Board
  • VMIC 320-250236 VMIVME 7588 VME Bus Assembly
  • VMIC VMIVME-7750-734000 VMEbus Module
  • GE Fanuc VMIVME-7750 VMEbus Input Board
  • VMIC VMIVME 4132 32-Channel Analog Output Board
  • VMIC VME-3418 Analog Input Module
  • VMIC VMIOMAX-8005A PLC Rack
  • GE PCI-5565 Reflective Memory Card
  • VMIC VMIVME-7750-3144702-09 CPU Module
  • Abaco VMIC VMIVME-5620 VME Module
  • VMIC VMIVME-2536 Digital I/O Board
  • Abaco VMIVME-7851-230100 VME Single Board Computer
  • VMIC 7487A CPU Board
  • VMIC 322-000228-137A VMIACC-BT09-137 Adapter Module
  • VMIC VMEbus 3230 Thermocouple Card
  • Abaco VMIVME-7455 VMEbus IDE CD-ROM Drive Module
  • VMIC VMIATX 5553 ATX Power Supply Module
  • VMIC VMIVME 1111 VMEbus Assembly – 332-001111-010D
  • Abaco VMIVME 7450 VMEbus Circuit Board with Floppy Drive
  • GE Fanuc VMIVME-4140-011 32-Channel Analog Output Board
  • VMIC VMIVME-2528-000 Digital I/O Board
  • VMIC VMIVME-7459 VMEbus Module
  • VMIC VMIVME 7452 VMEbus PCB Board
  • VMIC VMIVME-7750-259000 VMEbus CPU Module
  • VMIC VMIVME-7587 VMEbus Module Circuit Board
  • VMIC VMIVME-1101 VMEbus Circuit Board
  • VMIC 332-000132-B VMEbus PCB Board
  • VMIC VMIVME 2170A VMEbus PCB Board
  • VMIC VMIVME-7651-120000 VMEbus Single Board Computer
  • GE Fanuc VMIC VMIVME 2200 VMEbus Circuit Board
  • Abaco VMIPMC6100 PMC Gigabit Ethernet Adapter
  • FANUC VMIC VME-2528 128-Bit TTL Digital I/O Board
  • VMIC VMIVME 6015 VMEbus Serial Interface Board
  • GE Fanuc VMIVME-7750-740 VMEbus Processor Board
  • GE VMIC VMIVME 6016 16-Channel Serial Controller
  • VMIC VMIOMAX-9102A Power Supply Module
  • VMIC 7588 PCB Control Board
  • VMIC VMIVME-7696-650 VME Single-Board Computer
  • VMIC GE EV-SSI-01 Control Board
  • VMIC 4120 VMEbus VME Module
  • VMIC VMIVME-7587 VME Processor Board
  • VMIC VMICPCI-7767-13100 Single Board Computer
  • VMIC VMIVME1111 64-Bit High Voltage Input Board
  • VMIC 5 SV221 VME Module
  • VMIC VMIVME-7452-203 VME 6U Floppy Hard Disk Module
  • VMIC VMIVME-2536 5V Optically Coupled Digital I/O PCB Card
  • VMIC 332-000132-B VMEbus PCB Board
  • VMIC VMIVME-2510B 64-Bit TTL Digital I/O
  • VMIC 4514A VMEbus Analog I/O Board
  • VMIC VMIVME-7651-122000 VMEbus Single Board Computer
  • GE Fanuc VMIVME-4116 CPU Processor Controller
  • VMIC VMIVME-7587 SBC with VMIVME-7450 and Seagate ST34321A
  • VMIC VMIVME-4512-000G Analog I/O Processor Board
  • Abaco VMIVME-5521 ISA to VMEbus Link Module
  • VMIC VMIACC-0561 VMEbus P2 SCSI Transition Module
  • GE Fanuc VMIVME-4140 VME Module
  • VMIC 333-000132-C Optical Extender PCB Card
  • VMIC GE Fanuc VMIVME-4911 VME Processor Board
  • VMIC VMIVME-2128-011 High-Voltage Digital Output Board
  • VMIC VME-2532A Digital I/O Module
  • VMIC VMIVME-2528-110 Digital I/O VME SBC
  • VMIC VMIVME5576 VME Reflective Memory Board
  • VMIC VMIVME-3230 Thermocouple Card
  • VMIC VMIVME DR11W-A High Performance Interface Board
  • VMIC VMIVME7589 Processor Board
  • Abaco VMIVME-5565-11000 Reflective Memory Board
  • VMIC VMIOMAX-8005A PLC Rack
  • ABACO VMIC VMIACC BT03 Dual 96-Pin Transition Panel
  • VMIC VMIVME-5599 Fiber Optic Switch
  • VMIC VMIACC 0562 Accessory Module
  • GE Fanuc VMIVME 1182 VMEbus Input Board
  • VMIC VMIVME 7455 VMEbus IDE CD-ROM Drive Module
  • VMIC VMIOMAX-8001B PLC Rack