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 | 1169 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 HSDA 332-000111 Scanning Analog-to-Digital Converter Module
  • GE VMIC VMIVME1150B VME Module
  • FANUC VMIVME3128 VME Digital I/O Board
  • GE Fanuc VMIVME-7697-350 VMEbus Single Board Computer
  • GE Fanuc VMIVME-4150 PLC Board
  • FANUC VMIVME-1160A VMEbus Module
  • GE Fanuc VMIVME-4116 VMEbus CPU Processor Controller
  • FANUC VMIVME-9300 VMEbus Module
  • VMIVME-7589A Pentium VMEbus CPU Board
  • GE Fanuc VMIPCI-7767-13100 PCI Board
  • GE Fanuc VMIVME-4140 VMEbus Module
  • IS415UCVGH1A VME Controller Card
  • VMIC VMIVME-1150 VME Circuit Board
  • VMIC VMIVME7589 Processor Board
  • FANUC VMIVME-2200 VME Circuit Board
  • IS215UCVEH2A VME Controller Card
  • VMIC VMIVME-7589A-446 VMEbus CPU SBC
  • VMIC VMIVME-7658-330 VME Single Board Computer
  • VMIC SEMIVISION OPAL VMEbus CPU Module with VMIVME-7588
  • GE Fanuc VMIVME-4140 VME Module
  • Abaco VMIVME 2532A 32-Bit High-Voltage Digital I/O Board – VMEbus
  • VMIC VMIVME 100-Pin VME Bus I/O Cables
  • VMIC ASSY 11994R13 VMEbus Module
  • GE Fanuc VMIVME 1182 VMEbus Input Board – 332-011182-030A
  • VMIC VMIVME-7589 VMEbus Module with VMIVME-7434
  • VMIC VMIVME-7588-787 Single Board Computer – 332-250236
  • VMIC 7487A VMEbus CPU Board – 332-107487-033 H
  • FANUC VMIVME-3125 VMEbus Analog Input Board
  • VMIC VMIVME 6015 VMEbus Board – 332-006015-000
  • VMIC ASSY 11993R2 VMEbus Module
  • Cisco 2851 Router with VMIC2-1MFT-T1/E1 Module
  • Applied Materials VMIC 7505 800MHz CPCI SBC
  • VMIVME-2534-046D 32-Bit High-Voltage Digital I/O Board
  • VMIC 5530M Optical Extender PCB Board
  • GE VMIC XVB602 Control Module
  • VMIVME-6005-020 Octal ARINC-429 Controller
  • VMIC VMI PCI 3322 Board
  • FANUC VMIVME-7487 VME Processor Board
  • VMIC 332-800576-000A VMIACC 0576 Module
  • VMIC VMIVME-7805-231000 VME Board
  • ABACO VMIC VMICBL-000-F3-102 Reflective Memory Cable
  • VMIC 332-000131-B VMIVME PCB Card
  • VMIC 320-250236 with VMIVME-7588 Processor Board
  • VMIC ASSY 12149 Module
  • FANUC VMIC VMIVME5010 I/O PCB Board
  • VMIC VMIVME-7698-345 VME Single Board Computer
  • IS215UCVEH2A VME Controller Card
  • VMIC VMIVME-7658-330 VME Single Board Computer
  • VMIC VMIPCI-5790-000 Dual-Channel Ultra160 SCSI Adapter
  • VMIC VMICPCI-7756-460 Single Board Computer
  • VMIVME-4920 Dual Channel Digital Converter Board – VMEbus
  • GE Fanuc VMIVME-4140 VMEbus Module
  • VMIC VMIPMC-7440 PMC Sound Card
  • VMIC PCI 4320 VMEbus Board-333-854320-000
  • VMIC VMIVME 5530S VMEbus Interface Module
  • FANUC 332-999995-000 VMEbus PCB Assembly
  • FANUC VMIVME-4116-030 VMEbus Module
  • VMIC VMIVME-7658-330 VMEbus Single Board Computer
  • VMIC VME-2532A VMIVME2532A-413 Digital I/O Board
  • VMIC VMIVME-7696-650 VMEbus Processor Board
  • VMIC VMIVME-7487A Mainframe Board
  • GE Fanuc VMIVME-2120-175 Digital Output Board
  • Abaco VMIVME-4125A-000 System Test Calibration Board
  • VMIC VMICPCI-5579 Reflective Memory PCI Board
  • FANUC A860-2000-X003 Encoder Interface Module
  • FANUC 332-999992-000 VME Module
  • VMIC VMIVME-7698 VME Module
  • FANUC A860-2000-X003 Encoder Interface Module
  • VMIC 333-657755-000 B LSC-3 4201 Board
  • VMIVME-9304 CPU Board with NEC FGA-002A Interface Chip
  • VMIC VMIVME-7805 VMEbus Board – VMIVME-7805-234001
  • VMIC 332-000131-000M01 VMIVME PCB Card
  • FANUC GE VMIC VMIVME 2510B Digital I/O Board
  • VMIC VMIPMC-5795-000 PMC Ultra160 SCSI Adapter
  • GE Fanuc VMIVME 5588 High-Speed Reflective Memory Board
  • VMIC VMIVME 4132 VMEbus Analog Output Board
  • VMIC VMIVME-3418 8-Channel Strain Gauge and RTD Board
  • VMIC VMIPMC-5797-000 Ultra320 SCSI Host Bus Adapter
  • VMIC VMIACC 0562 Accessory Module
  • Abaco VMIVME 4116 8-Channel 16-Bit Analog Output Board
  • 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