Modbus

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Modbus RTU

Quick Guide
Bonfiglioli-Vectron ReSC
26.11.2012

11/2012 Modbus RTU Quick Guide 1


Content

Content.......................................................................................................................................... 2
1 Introduction............................................................................................................................ 3
2 Modbus (RTU) ......................................................................................................................... 4
2.1 Single read/write parameter ............................................................................................ 4
2.1.1 Frame Description ............................................................................................................... 4
2.1.2 Examples............................................................................................................................ 5
2.2 Block Read Function.......................................................................................................... 6
2.2.1 Predefine Block read Parameter ........................................................................................... 6
2.2.2 Frame Description ............................................................................................................... 6
2.2.3 Factory Settings .................................................................................................................. 7
2.2.4 Examples............................................................................................................................ 8

2 Modbus RTU Quick Guide 11/2012


1 Introduction
Modbus definitions for reading/writing data in a device do not fit directly to parameter access of inverters
(independent of inverter manufactures).Therefore it is necessary to map the register to the parameter num-
ber.

The current inverter software supports access to 16-Bit and 32-Bit parameters via Modbus Function Code
0x03 Read Holding Registers

The Modbus Block Read function allows the user to read up to 32 16-Bit parameters in one RTU block trans-
fer.
If 32-Bit parameters have to be read via block read, they are converted to 16-Bit value which means that the
accuracy is not as good as it could be.
For the Block Read function a different access method is required which does not conflict with the current
method of accessing parameters.

11/2012 Modbus RTU Quick Guide 3


2 Modbus (RTU)

2.1 Single read/write parameter

2.1.1 Frame Description

Request
Address Function Dataset/Parameter Number of Register CRC

Read response
Address Function No. Bytes Parameter Value CRC

The whole code is written in hexadecimal digits

The Address field contains the slave-address in the Modbus message. Valid slave node addresses are the
range of 1-247. A master addresses a slave by placing the slave address in the address field of the message.
When the salve returns its response, it places its own address in the response address field to let the master
know which slave is responding.
The Address is set in Parameter 1376.

The Function Code indicates to the inverter what kind of action to perform. The most important functions
for Bonfiglioli Inverter are:
Function 03 (0x03) to read out 16 and 32bit parameter
Function 06 (0x06) to write single 16bit parameter
Function 101 (0x65) to write single 32bit parameter

Dataset/Parameter is using the following algorithm:


DataSet/Parameter = parameter number + (data set * 4096)

The Datasets are connected as followed:


EEPROM RAM
Dataset 0 Dataset 5
Dataset 1 Dataset 6
Dataset 2 Dataset 7
Dataset 3 Dataset 8
Dataset 4 Dataset 9
The actual Values are always stored in Dataset 0 respectively Dataset 5.
For example to read dataset 5 of parameter 222 (222 + 5*4096 = 20702) you have to put “50 DE”.
If it is necessary to write parameter permanently/automatically to the inverter, it is indispensable to write
them to dataset 5,6,7,8 or 9. These Datasets are located on the internal RAM which will be erased after a
reboot/shutdown of the inverter. If you would write continuously to dataset 0 to 4 you would write to the
internal EEPROM which is limited to 1000000 writings. The only exception is, when you have to set a pa-
rameter manually/once to a value to do adjustments or similar.
For automatic write processes, it is necessary to use dataset 5-9 and you must not use dataset 0-4. Other-
wise you will destroy the controller of the AEC and it needs to be replaced.
The inverter is always working in data set 1 respectively 6. To write parameters it is recommend to use data
set 6.

No.Bytes For 16bit values there will be 2 Bytes; for 32bit values there will be 4 Bytes

Number of Register: To read out or to write 16bit values the number of register is 1. For 32bit values the
number of register is 2.

Parameter Value The value of the read out value or the new value of the parameter.

The CRC is the result of a “Redundancy Checking” calculation that is performed on the message contents.
To calculate the Cyclic Redundancy Check please check http://www.simplymodbus.ca/

4 Modbus RTU Quick Guide 11/2012


2.1.2 Examples

2.1.2.1 Read 16bit Register/Parameter

Example read parameter 213 Active Power (16bit) Dataset 0 of Inverter with Address 1

Request
Address Function Dataset/Parameter Number of Register CRC
01 03 00 D5 00 01 95 F2

Response of Inverter with Address 1 with 30kW


Address Function No.Bytes Parameter Value CRC
01 03 02 00 1E 38 4C

2.1.2.2 Write 16bit Register/Parameter

Example set parameter 1020 Power reduction reference value (16bit) Dataset 5 of Inverter with Address 1
to 50%

Request
Address Function Dataset/Parameter Parameter Value CRC
01 06 53 FC 00 32 D9 6B

Response
Address Function Dataset/Parameter Parameter Value CRC
01 06 53 FC 00 32 D9 6B

2.1.2.3 Read 32bit Register/Parameter

Example read parameter 850 frequency (32bit) Dataset 0 of Inverter with Address 1

Request
Address Function Dataset/Parameter Number of Register CRC
01 03 03 52 00 2 65 9E

Response of Inverter with Address 1 with 50,00Hz


Address Function No.Bytes Parameter Value CRC
01 03 04 00 00 C3 50 AA FF

2.1.2.4 Write 32bit Register/Parameter

Example set parameter 891 Filter Capacity Sinus Filter (32bit) Dataset 5 of Inverter with Address 1 to
10,000 mH

Request
Address Function Dataset/Para. Parameter Value CRC
01 65 53 7B 00 00 27 10 46 94

Response
Address Function Dataset/Para. Parameter Value CRC
01 65 53 7B 00 00 27 10 46 94

11/2012 Modbus RTU Quick Guide 5


2.2 Block Read Function

The Modbus Function 0x03 Read Holding Registers will be extended for the reading of up to 32 (RTU in-
verter parameters (16-Bit) in a single block transfer. This is used to reduce the Bus traffic.
The Modbus Block Read Function will allow the reading of up to 32 Inverter Parameters which correspond to
contiguous Modbus Register from Reg.No. 0xF01 to 0xF20 (3841-3872 dec.)
As the register numbers do not directly refer to the inverter parameter numbers, a mapping of the register
to inverter parameters is required.
This will carried out using an Index-Parameter with 32 indices, each containing an inverter parameter num-
ber selected from a choice list. The indices 1 – 32 refer to the register numbers 0xF01 – 0xF20 respectively.
All parameters corresponding to the Registers defined in the request are read in sequence and the data val-
ues then stored in the “Data” field of the Response Frame.

2.2.1 Possible Block Read Parameter


In VTable it is easy to define Index 1-32 of parameter 1282 (Block Read Parameter) via dropdown choice
list. It is possible to set the following parameter.
P. 213, "Active Power"
P. 222, "DC-Link Voltage" P. 867, "Power Supply Voltage b"
P. 250, "Digital Inputs" P. 868, "Power Supply Voltage c"
P. 255, "Heat Sink Temperature" P. 869, "Active Power a"
P. 256, "Inside Temperature" P. 870, "Active Power b"
P. 260, "Current Error" P. 871, "Active Power c"
P. 301, "Active Energy" P. 872, "Reactive Power a"
P. 850, "Frequency" P. 873, "Reactive Power b"
P. 852, "Power Supply Current" P. 874, "Reactive Power c"
P. 853, "Power Supply Voltage" P. 875, "Apparent Power a"
P. 855, "DC Power" P. 876, "Apparent Power b"
P. 860, "DC Current" P. 877, "Apparent Power c"
P. 863, "Current a" P. 878, "Reactive Power"
P. 864, "Current b" P. 879, "Apparent Power"
P. 865, "Current c" P. 1090, "Solar-State"
P. 866, "Power Supply Voltage a" P. 1161, "Reference Value Reactive Power"

The Inverter Parameter P.301 and P.850 are 32-bit Parameter which are converted to 16-Bit.
The frequency (P.850) value has 4 decimal places and is transferred without the decimal point, i.e. the value
is multiplied by 10000 (e.g. a frequency value of 50,0025 Hz is stored as 500025 which corresponds to
0x7A139 in HEX format.
In order to convert this value in 16-Bits it will be cut to two decimal places, i.e. the stored value will be di-
vided by 100. Using the example above 500025 (50,0025Hz) will be transferred as 5000 (50,00Hz) thus
loosing the last two decimal places.

The Active Energy (P.301) has no decimal places. The convention is done by dividing the value by 1000
respectively by changing from kWh to MWh (e.g. a active Energy value of 6189 kWh will be transferred as
6MWh.

2.2.2 Frame Description

Request
Address Function Dataset/Parameter Number of Register CRC

6 Modbus RTU Quick Guide 11/2012


01 03 0F 01 00 04 16 DD

Response
Address Function No.Bytes Data CRC
01 03 04 00 ... 50 AA FF

Address and Function see above


Dataset/Parameter Startposition to read out the predefined Block read Parameter 1282.
“0F 01” for Index 1 – “0F 20” for Index 32
Number of Register Among of parameter to read out.

No.Bytes depends on the among of the requested parameters (0x02 – 0x40)

Data:
Hi-Byte Lo-Byte Hi-Byte Lo-Byte
st st
1 .Par. 1 Par. … Nth. Nth
Par. par.
N = No. of Registers

2.2.3 Factory Settings


P.1282 Factory Setting Corresponding
Index Modbus Reg.No
1 213 – Active Power 0xF01
2 222 - DC-Link Voltage 0xF02
3 255 – Heat Sink Temperature 0xF03
4 256 – Inside Temperature 0xF04
5 260 – Current Error 0xF05
6 852 – Power Supply Current 0xF06
7 855 – Power Supply Voltage 0xF07
8 855 – DC Power 0xF08
9 879 – Apparent Power 0xF09
10 1090 – Solar Status 0xF0A
11 850 – Frequency 0xF0B
12 250 – Digital Inputs 0xF0C
13 860 – DC Current 0xF0D
14 301 – Active Energy 0xF0E
15 875 – Apparent Power a 0xF0F
16 876 – Apparent Power b 0xF10
17 877 – Apparent Power c 0xF11
18 869 – Active Power a 0xF12
19 870 – Active Power b 0xF13
20 871 – Active Power c 0xF14
21 863 – Current a 0xF15
22 864 – Current b 0xF16
23 865 – Current c 0xF17
24 866 – Power Supply Voltage a 0xF18
25 867 – Power Supply Voltage b 0xF19
26 868 – Power Supply Voltage c 0xF1A

11/2012 Modbus RTU Quick Guide 7


27 872 – Reactive Power a 0xF1B
28 873 – Reactive Power b 0xF1C
29 874 – Reactive Power c 0xF1D
30 878 – Reactive Power 0xF1E
31 1161- Reference Value Reac- 0XF1F
32 tive
222 Power
- DC-Link Voltage 0xF20

2.2.4 Examples

2.2.4.1 Read 4 Parameter in one Block transfer starting at Index 1

Request
Address Function Dataset/Parameter Number of Register CRC
01 03 0F 01 00 04 16 DD

Response
Address Function No.Bytes Data CRC
01 03 08 02 6C 15 85 02 46 01 A1 57 56

With factory settings:


P.213 = 02 6C  620 62,0kW
P.222 = 15 85  5509 550,9V
P.255 = 02 46 58258,2°C
P.256 = 01 A1 41741,7°C

8 Modbus RTU Quick Guide 11/2012

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy