KW1M-H Eco-POWER METER
66
◇
Data: Data depends on the function code.
A request message from the master side is composed of data item, number of data and setting data.
A response message from the slave side is composed of number of bytes, data and exception code in
negative acknowledgement.
◇
Error check: 16-bit data to detect communication errors. Refer to the next.
◇
Acknowledgement response
When command is to write 1 point, same massage of command is responded.
When command is to write several points, part of command message (6 bytes) is responded.
◆
Error check
After calculating CRC-16 (Cyclic Redundancy Check) from slave address to the end of data, the
calculated 16-bit data is appended to the end of message in sequence from low order to high order.
<How to calculate CRC>
In CRC system, the information is divided by the polynomial series. The remainder is added to the end
of the information and transmitted. The generation of polynomial series is as follows.
(Generation of polynomial series: X
16
+ X
15
+ X
2
+ 1)
1) Initialize the CRC-16 data (assumed as X) (FFFFH).
2) Calculate exclusive OR (XOR) with the 1st data and X. This is assumed as X.
3) Shift X one bit to the right. This is assumed as X.
4) When a carry is generated as a result of the shift, XOR is calculated by X of 3) and the fixed
value (A001H). This is assumed as X. If a carry is not generated, go to step 5).
5) Repeat steps 3) and 4) until shifting 8 times.
6) XOR is calculated with the next data and X. This is assumed as X.
7) Repeat steps 3) to 5).
8) Repeat steps 3) to 5) up to the last data.
9) Set X as CRC-16 to the end of message in sequence from low order to high order.
◆
Message example
<1> Reading electricity rate (0036H) of address 1
・
Command
3.5 idle
characters
Slave
address
(01H)
Function
code
(03H)
Data item
(0036H)
Number of
data
(0001H)
Error check
CRC-16
(6404H)
3.5 idle
characters
1
1
2
2
2
←
character
number
・
Response message from slave in normal status (When Rate=1000(10.00) [03E8H])
3.5 idle
characters
Slave
address
(01H)
Function
code
(03H)
Number of
response byte
(02H)
Number of
data
(03E8H)
Error check
CRC-16
(B8FAH)
3.5 idle
characters
1
1
1
2
2
←
character
number
<2> Setting electricity rate (0036H) of address 1 (When rate is set to 20.00(2000) [07D0H])
・
Command
3.5 idle
characters
Slave
address
(01H)
Function
code
(06H)
Data item
(0036H)
Number of
data
(07D0H)
Error check
CRC-16
(6A68H)
3.5 idle
characters
1
1
2
2
2
←
character
number
・
Response message from slave in normal status
3.5 idle
characters
Slave
address
(01H)
Function
code
(06H)
Data item
(0036H)
Number of
data
(07D0H)
Error check
CRC-16
(6A68H)
3.5 idle
characters
1
1
2
2
2
←
character
number