KEHUA MODBUS MAP For Solar Inverters Communication
KEHUA MODBUS MAP For Solar Inverters Communication
No part of this document may be reproduced or transmitted in any form or by any means without prior
written consent of Kehua Data Co., Ltd.
and other Kehua trademarks are trademarks of Kehua Data Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective holders.
Notice
The purchased products, services and features are stipulated by the contract made between Kehua and the
customer. All or part of the products, services and features described in this document may not be within the
purchase scope or the usage scope. Unless otherwise specification in the contract, all statements, information,
and recommendations in this document are provided “AS IS” without warranties, guarantees or
representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: www.kehua.com
E-mail: service@kehua.com
Tel: 0592-5160516
Fax: 0592-5162166
Contents
1 Overview......................................................................................................................................... 1
1.1 Protocol Intro ................................................................................................................................................... 1
1 Overview
UINT16 Unsigned integer of 16 bit. High byte front, low byte behind.
UINT32 Unsigned integer of 32 bit. High byte front, low byte behind.
INT16 Signed integer of 16 bit. High byte front, low byte behind.
INT32 Signed integer of 32 bit. High byte front, low byte behind.
MLB Multibyte
Bitfield16 The data that with 16 byte width and shows by bit. High byte front, low byte behind.
Name Description
Name Description
Frame interval Not less than the transmission time of 3.5 bytes
Intra-frame character interval Not larger than the transmission time of 1.5 bytes
Max. response time of the slave The transmission time of 150 bytes
Min. polling interval of the host The transmission time of 200 bytes
Name Description
Port ID 502
Name Description
IP Default: 192.168.1.10
2 Register Definition
Address
Meaning Remark Suitable device
(decimalism)
2521 Bus over-voltage 0-Normal 1-Abnormal
2522 Boost over-current (total) 0-Normal 1-Abnormal
2523 Temperature switch protection 0-Normal 1-Abnormal
2524 Fan fault 0-Normal 1-Abnormal
2525 Initialization fault 0-Normal 1-Abnormal
2526 DC SPD abnormal 0-Normal 1-Abnormal
2527 Inner over-temperature 0-Normal 1-Abnormal
2528 Temperature low 0-Normal 1-Abnormal
2529 External CT fault 0-Normal 1-Abnormal
2530 Smart meter abnormal 0-Normal 1-Abnormal
2531 Probation expired 0-Normal 1-Abnormal
2532 Probation approching 0-Normal 1-Abnormal
2533 HMI communication fault 0-Normal 1-Abnormal
2534-2535 Reserved 0-Normal 1-Abnormal
Address
Meaning Remark Suitable device
(decimalism)
2597 Overload alarm 0-Normal 1-Abnormal
2598 Overload protection 0-Normal 1-Abnormal Energy storage
2599 Short-circuit protection 0-Normal 1-Abnormal device
PV fault inforamtion:
Address
Meaning Remark Suitable device
(decimalism)
MPPT1 over-voltage -MPPT8
2629-2636 over-voltage (low address corresponds 0-Normal 1-Abnormal
MPPT1)
MPPT1 over-current -MPPT8
2637-2644 over-current (low address corresponds 0-Normal 1-Abnormal
MPPT1)
MPPT1 reverse connected -MPPT8
2645-2652 reverse connected (low address 0-Normal 1-Abnormal
corresponds MPPT1)
MPPT1 insulation fault-MPPT8
2653-2660 insulation fault (low address corresponds 0-Normal 1-Abnormal
MPPT1)
MPPT1 over-temperature - MPPT8
2661-2668 over-temperature (low address 0-Normal 1-Abnormal
corresponds MPPT1)
MPPT1 DC arc fault -MPPT8 DC arc
2669-2676 0-Normal 1-Abnormal
fault (low address corresponds MPPT1)
2677-2692 Reserved for MPPT fault 0-Normal 1-Abnormal
PV1 over-current- PV32 over-current
2693-2724 0-Normal 1-Abnormal
(low address corresponds PV1)
PV1 reverse connected-PV32 reverse
2725-2756 connected (low address corresponds 0-Normal 1-Abnormal
PV1)
2757-2820 Reserved for PV fault 0-Normal 1-Abnormal
None
For the data of dobule word (32bit) or more, it will send high word and then send low word.
Address
Meaning Byte Data type Remark (unit) Suitable device
(decimalism)
4521 Inner temperature 2 INT16 0.1℃
Grid-connected total
4522 2 UINT16 0.1kVA
apparent power
4523 IGBT temperature 2 INT16 0.1℃
4524 Reserved 2 UINT16
4525 Reserved 2 UINT16
4526 Output power factor 2 INT16 0.01
4527 PV input total power 2 UINT16 0.1kw
4528 AC leakage current 2 UINT16 0.1mA
Energy storage
4529 Daily power consumption 2 UINT16
device
Energy storage
4530-4531 Total power consumption 4 UINT16
device
4532 On-grid active power 2 INT16 0.1kW
4533 On-grid apparent power 2 INT16 0.1kVA On-Gride
4534 On-grid reactive power 2 INT16 0.1kVar Information
Address
Meaning Byte Data type Remark (unit) Suitable device
(decimalism)
4622 Load power factor 2 UINT16 0.01
Daily load power
4623 2 UINT16 0.1kwh
consumption
0.1kwh, low
Total load power address corresds
4624-4625 4 UINT16
consumption the low bit of
electric auantity
Load related information,
4626-4650 48 UINT16
reserved
Sysatem information
Address
Meaning Byte Data type Remark (unit) Suitable device
(decimalism)
4800-4809 Model (ASCII) 20 UINT8 The place less than
Address
Meaning Byte Data type Remark (unit) Suitable device
(decimalism)
4810-4814 Reserved 10 UINT8 the required
character is filled
4815-4819 Reserved 10 UINT8 with zero (ASCII
4820 HMI version (ASCII) 10 UINT8 code literal
translation)
4825-4834 S/N (ASCII) 20 UINT8
4835-4839 Reserved 10 UINT8
Control software 1's The place less than
4840-4844 10 UINT8
version (ASCII) the required
character is filled
Control software 2's with zero (ASCII
4845-4849 10 UINT8 code literal
version (ASCII)
translation)
1-Three-phase PV
inverter
4850 Device type 2 UINT16 2- Three-phase PV
energy-storage
inverter
MPPT branch's
4851 MPPT quantity 2 UINT16
quantiry
1-three-phase
protocol
4852 Protocol type 2 UINT16 2-single-phase
protocol
3-PID protocol
The place less than
the 10 characters is
filled with zero.
For example: If the
protocol version's
content is V1.04,
detail vaule is 56
4853-4857 Protocol version (ASCII) 10 UINT8 31 2E 30 34 00 00
00 00 00, it
expands from low
register address to
high register
address.
Default:V1.08
The place less than
4858-4872 Manufacturer info. (ASCII) 30 UINT8 the 30 characters is
filled with zero.
Total branch
4873 PV branch's quantity 2 UINT16
quantity
4874 Remaining probation time
Address
Meaning Byte Data type Remark (unit) Suitable device
(decimalism)
The place less than
the required
Control software 3's character is filled
4875-4879 10 UINT8
version (ASCII) with zero (ASCII
code literal
translation)
when useing PID module, it needs to check the list completely (that is to say, the register address 5000-5004 must
be read in one frame) and the read data can be not disposed.
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
5009 Reserved
Recover grid-connected
5010 2 OFF- not recover; ON-recover
enable
5011-5063 Reserved
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
0.01(Negative complement in
6002 Power factor 2
the form of complement)
0.1kW
0.1kW device
Battery charge/discharge
6005 2 +: discharge
power
-: charge
6006-6019 Reserved 2
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
6207-6304 Reserved
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
[0x0000,0xFFFF]
bit0~15: PV 1~16
6305 PV alarm shielding 2
0: PV alarm enable; 1: PV
alarm shielding
6306-6349 Reserved 2
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
[0,3]
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
[0,3]
6354 Charge rate 2
0-0.1C, 1-0.2C, 2-0.5C, 3-1C
Battery over-voltage
6357 2 0.1V
protection
Battery low-voltage
6358 2 0.1V
protection
6361-6399 Reserved
Address
Meaning Byte Remark Suitable device
(decimalism)
Grid level 2 over-voltage
6404 2 0.1%
protection ponit
Grid level 1 low-voltage
6405 2 0.01s
protection time
Grid level 2 low-voltage
6406 2 0.01s
protection time
Grid level 3 low-voltage
6407 2 0.01s
protection time
Grid level 1 over-voltage
6408 2 0.01s
protection time
Grid level 2 over-voltage
6409 2 0.01s
protection time
Grid low-voltage
6410 2 0.1%
protection recover point
Grid over-voltage
6411 2 0.1%
protection recover point
Grid level 1 low-frequency
6412 2 0.01Hz
protection time
Grid level 2 low-frequency
6413 2 0.01Hz
protection time
Grid level 1
6414 over-frequency protection 2 0.01Hz
time
Grid level 2
6415 over-frequency protection 2 0.01Hz
time
Grid level 1 low-frequency
6416 2 0.01s
protection time
Grid level 2 low-frequency
6417 2 0.01s
protection time
Grid level 1
6418 over-frequency protection 2 0.01s
time
Grid level 2
6419 over-frequency protection 2 0.01s
time
Grid low-frequency
6420 2 0.01Hz
protection recover point
6421 Grid over-frequency 2 0.01Hz
Address
Meaning Byte Remark Suitable device
(decimalism)
protection recover point
[0,2]
6426 L/HVRT mode 2 0-off; 1-reactive power
support mode;2-zero reactive
mode
0.1%
L/HVRT protection voltage
6427 2 zero reactive power mode take
HV2
effect
0.01s
L/HVRT protection time
6428 2 zero reactive power mode take
HT2
effect
0.1%
L/HVRT protection voltage
6429 2 zero reactive power mode
HV1
take effect
0.01s
L/HVRT protection time
6430 2 zero reactive power mode
HT1
take effect
0.1%
L/HVRT protection voltage
6431 2 zero reactive power mode take
LV1
effect
0.01s
L/HVRT protection time
6432 2 zero reactive power mode take
LT1
effect
0.1%
L/HVRT protection voltage
6433 2 zero reactive power mode take
LV2
effect
0.01s
L/HVRT protection time
6434 2 zero reactive power mode take
LT2
effect
0.1%
L/HVRT protection voltage
6435 2 zero reactive power mode take
LV3
effect
0.01s
L/HVRT protection time
6436 2 zero reactive power mode take
LT3
effect
6437 L/HFRT mode 2 [0,1] 0-off;1-on
L/HFRT protection
6438 2 0.01Hz
frequency HF2
Address
Meaning Byte Remark Suitable device
(decimalism)
L/HFRT protection time
6439 2 0.01s
HT2
L/HFRT protection
6440 2 0.01Hz
frequency HF1
L/HFRT protection time
6441 2 0.01s
HT1
L/HFRT protection
6442 2 0.01Hz
frequency LF1
L/HFRT protection time
6443 2 0.01s
LT1
L/HFRT protection
6444 2 0.01Hz
frequency LF2
L/HFRT protection time
6445 2 0.01s
LT2
6446 P-V mode 2 [0,2] 0-off;1-linear;2-loop
6447 P-V mode V1 (discharge) 2 0.1%
6448 P-V mode P1(discharge) 2 1%
6449 P-V mode V2(discharge) 2 0.1%
6450 P-V mode P2(discharge) 2 1%
6451 P-V mode V3(discharge) 2 0.1%
6452 P-V mode P3(discharge) 2 1%
[0,2]
6459 P-F mode 2
0-off;1-linear;2-loop
6460 P-F mode F1(discharge) 2 0.01Hz
6461 P-F mode P1(discharge) 2 1%
6462 P-F mode F2(discharge) 2 0.01Hz
6463 P-F mode P2(discharge) 2 1%
6464 P-F mode F3(discharge) 2 0.01Hz
6465 P-F mode P3(discharge) 2 1%
6472 Q-V mode 2 [0,1] 0-off;1-on
6473 Q-V mode V1 2 0.1%
6474 Q-V mode Q1 2 1%
6475 Q-V mode V2 2 0.1%
Address
Meaning Byte Remark Suitable device
(decimalism)
6476 Q-V mode V3 2 0.1%
6477 Q-V mode V4 2 0.1%
6478 Q-V mode Q4 2 1%
6479 Q-V mode Hysteresis 2 0.1%
6480 SPF mode 2 [0,1] 0-off;1-on
6481 SPF mode P1 2 1%
6482 SPF mode PF1 2 0.01
6483 SPF mode P2 2 1%
6484 SPF mode PF2 2 0.01
6485 SPF mode P3 2 1%
6486 SPF mode PF3 2 0.01
6490 ON/OFF soft start rate 2 0.01%
6491 P-F mode hysteresis time 2 0.01s
[0,2]
6492 P-LF mode 2
0-off;1-linear;2-loop
6493 P-LF mode F1(discharge) 2 0.01Hz
6494 P-LF mode F2(discharge) 2 0.01Hz
6495 P-LF mode F3(discharge) 2 0.01Hz
6496 P-LF mode P1(discharge) 2 1%
6497 P-LF mode P2(discharge) 2 1%
6498 P-LF mode P3(discharge) 2 1%
Grid level 3 over-voltage
6499 2 0.1%
protection
Grid level 4 over-voltage
6500 2 0.1%
protection
Grid level 4 low-voltage
6501 2 0.1%
protection point
Grid level 3 over-voltage
6502 2 0.01s
protection time
Grid level 4 over-voltage
6503 2 0.01s
protection time
Grid level 4 low-voltage
6504 2 0.01s
protection time
Address
Meaning Byte Remark Suitable device
(decimalism)
Grid level 3
6505 over-frequency protection 2 0.01Hz
point
Grid level 4
6506 over-frequency protection 2 0.01Hz
point
Grid level 3 low-frequency
6507 2 0.01Hz
protection point
Grid level 4 low-frequency
6508 2 0.01Hz
protection point
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
Charge period setting -
6030 2
period 2 anding time
Charge period setting -
6031 2
period 3 starting time
Charge period setting -
6032 2
period 3 anding time
Charge period setting -
6033 2
period 4 starting time
Charge period setting -
6034 2
period 4 anding time
Charge period setting -
6035 2
period 5 starting time
Charge period setting -
6036 2
period 5 anding time
Charge period setting -
6037 2
period 6 starting time
Charge period setting -
6038 2
period 6 anding time
Discharge period setting-
6039 2
period quantity
Discharge period setting -
6040 2
period 1 starting time
Discharg period setting -
6041 2
period 1 anding time
Discharge period setting -
6042 2
period 2 starting time
Discharg period setting -
6043 2
period 2 anding time
Discharge period setting -
6044 2
period 3 starting time
Discharg period setting -
6045 2
period 3 anding time
Discharge period setting -
6046 2
period 4 starting time
Discharg period setting -
6047 2
period 4 anding time
Discharge period setting -
6048 2
period 5 starting time
Address
Meaning Byte Remark (unit) Suitable device
(decimalism)
Discharg period setting -
6049 2
period 5 anding time
Discharge period setting -
6050 2
period 6 starting time
Discharg period setting -
6051 2
period 6 anding time
6052-6199 Reserved
Function code 03 is used to judge whether the read content is wrote correctly.
Address
Meaning Byte Remark (unit)
(decimalism)
None
Active power and reactive power needs to be set separately, if n sets of inverter will be set, it needs to write 2*n+1
register.
For example:
The broadcast write power point quantity: 0x00 0x03 (10 points)
Address 1: 0x00 0x01 (Address 1, user can set the device address by themselive
that will be broadcasted)
Address 2: 0x00 0x20 (Address 32, user can set the device address by
themselive that will be broadcasted)
Address 3: 0x00 0x3F (Address 63, user can set the device address by
themselive that will be broadcasted)
Uint16uCRCHi=0xff;
Uint16 uCRCLow=0xff;
Uint16 CRC=0xffff;
Uint16 CRCFlag=0;
Uint16 i=0,j=0;
for(j=0;j<n;j++)
CRC=CRC^buf[j];
for(i=0;i<8;i++)
CRCFlag=CRC&0x0001;
CRC=CRC>>1;
if(CRCFlag==1)
CRC=CRC^0xa001;
uCRCHi=CRC&0x00ff;
uCRCLow=(CRC>>8)&0x00ff;
return (uCRCHi<<8|uCRCLow);
If the slave's address is set to 0x01 and query running information (address is 4501-4510), the host will send the
information frame as follows:
01 04 14 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 0A B9 F0
6 Others
For the communicaiton protocol and inquiry logic of history record, I-V curve scan and fault wave etc, please
contact us.
xx 0x01 xx xx xx xx xx xx
xx 0x01 xx xx … xx xx xx
The bit 0 of register 1 of response information is corresponding to the starting address in the request, If
the returned register quantity is less than 8 or not a multiple of eight, the remaining bits in the final
register will be padded with zeros.
xx 0x02 xx xx xx xx xx xx
xx 0x02 xx xx … xx xx xx
The bit 0 of register 1 of response information is corresponding to the starting address in the request, If
the returned register quantity is less than 8 or not a multiple of eight, the remaining bits in the final
register will be padded with zeros.
xx 0x03 xx xx xx xx xx xx
Slave response(Hexadecimal)
xx 0x03 xx xx xx … … xx xx xx xx
Reading one or more registers is distinguished by the quantity of register. If the quantity of register is 1,
it means that there is one register. If the quantity of register is more than 1, it means that there are
several registers. Register 1 is corresponding to the starting address.
xx 0x04 xx xx xx xx xx xx
Slave response(Hexadecimal)
xx 0x04 xx xx xx … … xx xx xx xx
Reading one or more registers is distinguished by the quantity of register. If the quantity of register is 1,
it means that there is one register. If the quantity of register is more than 1, it means that there are
several registers. Register 1 is corresponding to the starting address.
xx 0x05 xx xx xx xx xx xx
For the write input status can be ON/OFF only, 0xFF00 request input status is ON, 0x0000 request
input status is OFF.
Slave response(Hexadecimal):
xx 0x05 xx xx xx xx xx xx
xx 0x06 xx xx xx xx xx xx
Slave response(Hexadecimal)
xx 0x06 xx xx xx xx xx xx
xx 0x10 xx xx xx xx xx xx xx … xx xx
Slave response(Hexadecimal)
xx 0x10 xx xx xx xx xx xx
xx 0xE0 xx xx xx xx xx xx xx … xx xx
Slave response(Hexadecimal)
xx 0xE0 xx xx xx xx xx xx
Slave response(Hexadecimal)
CRC check
ID Function code Error code
Low byte High byte
xx xx|0x80 xx xx xx
When the communication module of the inverter detects error except CRC error, it must send the
information to the host. The highest bit of function codes is 1, that is, add 128 at the sent function
code of host. The responded and sent error codes of inverter's communication module are as follows:
0x01 Invalid function code The server does not understand the function code
0x11 No authority
A special header used on the TCP/IP is to indentify ModBus application data unit, called MBAP header
(ModBus protocol header).
The difference between ModBus TCP data frame and serial link data frame:
Transaction
ModBus request response Server recopys from the
processing ID 2 byte Client start
transaction processing ID received request
box
Client
Length 2 byte Number of bytes Client(response) start
start(request)
Transaction processing ID box: Used for transaction matching. In response, the ModBus server
copies the transaction processing ID of the request.
Protocol ID: Used for multiplexing within system. The ModBus protocol is indentified by a value
of 0.
Length: The length filed is the number of bytes in the next field, including unit ID and data field.
Unit ID: This field is used for intra-system routing. Dedicated to communication between
ModBus or ModBus + serial link slaves by a gateway between an Ethernet TCP-IP network and a
ModBus serial link. The ModBus client sets this field in the request, and the server must return
this field with the same value in the response.
All ModBus/TCP ADUs are sent through TCP on the registered port 502.
Request PDU
0x01 xx xx xx xx
Response PDU
0x01 xx xx … xx
The bit 0 of register 1 of response information is corresponding to the starting address in the request, If
the returned register quantity is less than 8 or not a multiple of eight, the remaining bits in the final
register will be padded with zeros.
Request PDU
0x02 xx xx xx xx
Response PDU
0x02 xx xx … xx
The bit 0 of register 1 of response information is corresponding to the starting address in the request, If
the returned register quantity is less than 8 or not a multiple of eight, the remaining bits in the final
register will be padded with zeros.
Request PDU
0x03 xx xx xx xx
Response PDU
code quantity High byte Low byte … … High byte Low byte
0x03 xx xx xx … … xx xx
Reading one or more registers is distinguished by the quantity of register. If the quantity of register is 1,
it means that there is one register. If the quantity of register is more than 1, it means that there are
several registers. Register 1 is corresponding to the starting address.
Request PDU
0x04 xx xx xx xx
Response PDU
0x04 xx xx xx … … xx xx
Reading one or more registers is distinguished by the quantity of register. If the quantity of register is 1,
it means that there is one register. If the quantity of register is more than 1, it means that there are
several registers. Register 1 is corresponding to the starting address.
Request PDU
0x05 xx xx xx xx
For the write input status can be ON/OFF only, 0xFF00 request input status is ON, 0x0000 request input status is
OFF.
Request PDU
0x06 xx xx xx xx
Response PDU
0x06 xx xx xx xx
Request PDU
0x 10 xx xx xx xx xx xx xx …
Response PDU
0x 10 xx xx xx xx
Response PDU
xx|0x80 xx
When the communication module of slave detects error except CRC error, it must send the
information to the host. The highest bit of function code is 1, that is, add 128 at the sent function code
of host. The responded and sent error codes of slave's communication module are as follows:
0x01 Invalid function code The server does not understand the function code