Panasonic KW4M User Manual page 35

Eco-power meter
Table of Contents

Advertisement

◇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-bite) 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
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
value (A001H). This is assumed as X. If a carry is not generated, go to step
5
Repeat steps
6
XOR is calculated with the next data and X. This is assumed as X.
7
Repeat steps
8
Repeat steps
9
Set X as CRC-16 to the end of message in sequence from low order to high order.
◆Message example
① Reading electricity rate (0032H) of address 1
・Command
3.5 idle
address
characters
・Response message from slave in normal status (When Rate=1000(10.00) [03E8H])
3.5 idle
address
characters
② Setting electricity rate (0032H) of address 1 (When rate is set to 20.00(2000) [07D0H])
・Command
3.5 idle
address
characters
・Response message from slave in normal status
3.5 idle
address
characters
16
15
+ X
+ X
3
and
4
until shifting 8 times.
3
to
5
.
3
5
to
up to the last data.
Slave
Function
code
(01H)
(03H)
1
1
Slave
Function
code
(01H)
(03H)
1
1
Slave
Function
code
(01H)
(06H)
1
1
Slave
Function
code
(01H)
(06H)
1
1
2
+ 1)
Data item
Number of
data
(0032H)
(0001H)
2
Number of
Number of
response byte
data
(02H)
(03E8H)
1
Data item
Number of
data
(0032H)
(07D0H)
2
Data item
Number of
data
(0032H)
(07D0H)
2
3
and the fixed
5
.
Error check
CRC-16
(25C5H)
2
2
Error check
CRC-16
(B8FAH)
2
2
Error check
CRC-16
(2BA9H)
2
2
Error check
CRC-16
(2BA9H)
2
2
3.5 idle
characters
←character
number
3.5 idle
characters
←character
number
3.5 idle
characters
←character
number
3.5 idle
characters
←character
number
29

Advertisement

Table of Contents
loading

Table of Contents