1 2 3 4 5 6 7 8
8. Communication protocol
EH8 series meter adpots Modbus RTU communication protocol , RS485 half duplex communication,read function code 0x03,
write function code 0x10, adpots 16 digit CRC check,the meter does not feedback when check error
.
Data frame format:
Communication abnormal solution:
When abnormal answer, the highest bit of function code will be set to 1. For example, if the request function code from master unit is 0x04,
the return function code from the meter is 0x84.
Error type code
0x01---Function code error: The meter does not support the function code it receives.
0x02---Data position error: The data position assigned by master unit is out of the range of meter
the
0x03---Data value error: The data value sent from master unit is out of the range of the meter
Start bit
Data bit
Stop bit
Check bit
1
1
8
No
8.1. Read multi-register
For example, master unit reads float data AL1
(
1st alarm value 241.5)
The address code of AL1 is 0x0000, because AL1 is floating data(4 byte), it covers 2 data registers. According to IEEE-754, the standard
hexadecimal memory code of decimalist float data 241.5 is 0x00807143.
Master unit request (Read multi-register)
0x01 0x03 0x00 0x00 0x00 0x02 0xC4 0x0B
Meter address Function code
Start address
High bit
Start address
Low bit
Data byte
length Low bit
Data byte
length High bit
CRC code
Low bit
CRC code
high bit
Slave unit normal answer (Read multi-register)
1 2 3 4 5 6 7 8 9
0x01 0x03 0x04 0x00 0x80 0x71 0x43 0x9E 0x7A
Meter address Function code
Data byte
number
Data 1
High bit
Data 1
Low bit
Slave unit abnormal answer(Read multi-register)
1 2 3 8 9
0x01 0x84 0x01 0x82 0xC0
Meter address Function code
Error code
Function code abnormal answer:(For example, master unit request function code is 0x04)
8.2. Write multi-register
For example
:
Master unit reads float data HY1
(
1st alarm hysteresis value 20.5).The address code of HY1 is 0x0001, because HY1 is
float data (4 bytes),seizes 2 data registers. According to IEEE-754 standard, the hexadecimal memory code of decimalist float data
20.5 is 0x0000A441.
1 2 3 4 5 6 7 8 9 10 11 12 13
0x01 0x10 0x00 0x01 0x00 0x02 0x04 0x00 0x00 0xA4 0x41 0x88 0x93
1 2 3 4 5 6 7 8
0x01 0x10 0x00 0x01 0x00 0x02 0x10 0x08
1 2 3 8 9
0x01 0x90 0x02 0xCD 0xC1
Data position error answer:(For example, master unit request write address index is 0x0050)
Data 1
high bit
Data 2
high bit
Data 1
low bit
Data 2
low bit
Data 2
High bit
Data 2
Low bit
CRC code
Low bit
CRC code
high bit
CRC code Low bit
CRC code high bit
Meter
address
Function
code
Start
address
High bit
Start
address
Low bit
Data
byte
length
High bit
Data
byte
length
Low bit
Data
byte
length
CRC
code
Low bit
CRC
code
high bit
Master unit request (Write multi-register)
Meter
address
Function
code
Start address
High 8 bit
Start address
Low 8 bit
Data byte
length High bit
Data byte
length Low bit
CRC code
Low bit
CRC code
high bit
Slave unit normal answer (Write multi-register)
Slave unit abnormal answer (Read multi-register)
Meter address Function code
Error code
CRC code Low bit
CRC code high bit
KKEH8E01-A/0-5