Modbus RTU Communication Control between HD700 Frequency Converter and Siemens PLC S7-200

1 Introduction

Industrial control has moved from stand-alone control to centralized monitoring and distributed control. Today, it has entered the era of network-intensive manufacturing. Industrial controller networking also facilitates network management. Modbus is one of the industrial controller's network protocols. The Modbus protocol is a communication protocol applied to electronic controllers. Through this protocol, controllers can communicate with each other, controllers via a network (such as Ethernet), and other devices. It has become one of the mainstream industry standards. The control equipment produced by different manufacturers conforming to the Modbus protocol can be connected to an industrial network for centralized monitoring.
2. Application Principle of Modbus RTU Protocol in S7-200
2.1 Introduction to the Relationship between Modbus RTU Protocol and S7-200
Siemens developed a command library specifically for Modbus RTU communication, which greatly simplifies the development of Modbus RTU communication and facilitates the rapid implementation of related applications. The Modbus RTU command library enables the S7-200 to be integrated as a master and slave device in a Modbus RTU into a Modbus network for communication between Modbus devices. The following figure shows Micro/WIN's Modbus RTU command library.

Figure 1 Library instructions in the instruction tree

2.2, Modbus RTU master station protocol instruction
The Siemens Modbus Master Protocol Library contains two instructions: the MBUS_CTRL instruction and the MBUS_MSG instruction.
The MBUS_CTRL instruction is used to initialize the master communication. The MBUS_MSG instruction is used to initiate the request to the Modbus slave and process the reply.
The MBUS_MSG instruction is used to initiate a request for a Modbus slave and process the reply.
3, HD700 series inverter Modbus RTU communication
(1) Communication interface
HD700 frequency converter integrates standard RS485 serial communication interface: standard 8-pin RJ45 port; 485 protocol communication terminals A (RS485+), B (RS485?). Both can be used together. A single master/slave or single master/multiple slave control system can be formed. The inverter can only be used as a slave.
(2) Communication
HD700 frequency changer communication agreement is Modbus agreement, RTU message transmission way, supports the common register to read and write. The frame format as shown
Figure 2 Modbus RTU protocol format
Modbus RTU uses the "big-endian" code to represent the address and data items (except for the "little-endian" CRC), which is transmitted first followed by the lower byte.
(3) Command Codes The Modbus RTU protocol supports the following operations.
Table 1 Command Codes


Command code (hexadecimal)
meaning
03H
Read the contents of multiple registers
06H
Modify the contents of a single register. After the inverter is powered off, the modified value is not saved.
10H
Modify the contents of multiple registers. After the inverter is powered off, the modified value is not saved.
17H
Read and modify the contents of multiple registers. After the inverter is powered off, the modified value is not saved.


(3) Mapping between parameter function code and HD700 internal Modbus register

The parameter codes of the HD700 drive are mapped to the Modbus read and write registers. The rules for mapping are:
Parameter function code × 100 = M × 256 + N + 1 Decimal representation, where 0 ≤ N ≤ 255
High byte low byte Register address
E.g:
Find the Modbus register address of parameter P02.07
2.07 × 100 = 0 × 256 + 206 + 1, then M = 0, N = 206, converted to hexadecimal high byte 00H,
The low byte CEH, the register address is 00CEH. For details, refer to the HD700 User's Manual.
(4) Communication parameters of HD700 inverter
When the HD700 inverter communicates with the host computer, relevant communication parameters need to be set. See Table 2 below.

Table 2 Parameters related to communication of HD700 inverter

Parameter ID
parameter name
Parameter setting range
Defaults
Change way
Modbus address
P00.03
(P10.07)
control method
0: keyboard control
1: Terminal control
2: Communication control
0
Stop Only
0002H(03EEH)
P00.04
(P01.01)
Given channel
0: Keyboard adjustment
1: UP, DOWN terminal adjustment
2: Multistage speed given
3: AI1 simulation
4: AI2 simulation
5: Serial port communication given
6: DI7 terminal pulse given
7: Bus given
8: Customization given
0
Run&Stop
0003H(0064H)
P03.27
Communication control word
0~65535
0
Run&Stop
0146H
P03.28
Communication control word enable
0~1
0
Run&Stop
0147H
P10.02
Local address
0~247
1
Run&Stop
03E9H
P10.03
Communication baud rate
0:2.4KBPS
1:4.8KBPS
2:9.6KBPS
3:19.2KBPS
4:38.4KBPS
5:57.6KBPS
3
Run&Stop
03EAH
P10.04
Communication configuration
0:1-8-1, RTU, no parity
1:1-8-2, RTU, no parity
2:1-8-1, RTU, odd parity
3:1-8-1, RTU, Even Check
1
Run&Stop
03EBH
P10.05
Native response delay
0ms to 250ms
2
Run&Stop
03ECH
P10.14
Inverter status word
0~65535
Actual test value
Actual
03F5H

In the above table, set:

P00.03(P10.07)=2 Communication control inverter.
P00.04(P01.01)=5 The serial communication is selected for the given channel. At this time, the host computer adjusts the given frequency by changing the value of parameter P04.01.
P03.28=1 Enable Communication Control Word
P10.03=3 communication baud rate 19.2KBPS
P10.04=0 Communication configuration 1-8-1, RTU, no parity
P03.27 Communication control word.
The meaning of each bit of this parameter is shown in the table below.
Table 3 Meaning of communication control word P03.27

Bit
Bit function
0
Inverter prohibited
1
run
2
Three-wire mode enable
3
Forward operation
4
Reverse running
5
Forward Reverse
6
Forward rotation
7
Reverse rotation
8
Fault reset
9
Save parameters
10
Fault record is cleared
11
Enable serial port change function selection parameters
12
Reserved
13
Reserved
14
Reserved
15
Reserved

Refer to the HD700 user manual. The command address for the control word is H0146. Defined by the control word, control the inverter to write H0008 forward, reverse H0010, stop H0000. When writing the frequency, the corresponding register address H0190 (parameter P04.01), the frequency calibration is 1:100.

4, HD700 frequency converter and S7-200 PLC communication wiring
Figure 3 HD700 frequency converter and S7-200 PLC wiring diagram
5, HD700 frequency converter and S7-200 Modbus RTU communication program design
Function: HD700 seven-speed inverter and Siemens S7-200 communication routines (read and write);
Applicable: Siemens S7-200P LC, verified on the CPU 224XP;
Detailed function description: This program is the routine of HD700 frequency converter and S7-200P LC communication to carry out the frequency changer to run, stop control and use the communication to rewrite the setting frequency of the frequency converter and read its running frequency. I0.0 to I0.4 are buttons, where:
I0.0 is the forward rotation control of the inverter
I0.1 is the inverter control
I0.2 is the stop control of the inverter
I0.3 accelerates the inverter
I0.4 is the inverter deceleration
The communication format of this program: baud rate 19200, 1-8-1, RTU, no verification.

Smartwatch

Smartwatch

Smartwatch,Smart Watch,Screen Touch Watch,G Shock Smart Watch

everyone enjoys luck , https://www.eeluckwatch.com