
11
CARLO GAVAZZI
CONTROLS
SERIAL COMMUNICATION PROTOCOL
WM4-96
V1 R3
Page
(the decimal point position has to be set to “1.11Kwh (Kvarh)”).
Whereas the total meters MSB (5
th
byte) is contiguous to the less significant bytes, the partial meters
MSB (5
th
byte) is stored in a different area of the memory. For this reason it is required to carry out
two different read commands in order to get all the energy meter information.
2.5 READING OF THE ENERGY METER VALUES
8-bytes request frame (read command, 10 word):
01h 04h 00h ECh 00h 0Ah
CRC
CRC
25-bytes answer frame (read command):
1
ECh
2
EDh
3
EEh
4
EFh
5
F0h
6
F1h
7
F2h
8
F3h
9
F4h
10
F5h
01h 04h 14h 00h 00h
00h 00h 94h 59h FFh
FFh 94h 02h
11
F6h
12
F7h
13
F8h
14
F9h
15
FAh
16
FBh
17
FCh
18
FDh
19
Feh
20
FFh
00h 00h BEh
FEh
FFh
FFh 00h 00h 00h 00h
CRC
CRC
Starting from address ECh, it is possible to read all the energy meters by means of a single read
command (10 word, see the example above).
Reconstruction of the kWh+ total meter
The first 4 data bytes (less significant bytes) have to be placed side by side in the opposite order:
4
Efh
3
EEh
2
EDh
1
ECh
00h 00h 00h 00h
00000000h=0
The obtained 32-bit value has to be interpreted as a two’s complement value.
The relevant kWh+ MSB (byte n° 17), which has to be interpreted as a two’s complement value too,
must be multiplied by 1000000000 (decimal value). The result has to be algebraically added to the
previous value.
17
FCh
00h
1000000000*0=0
Finally the last result has to be divided by 100.
0+0/100=0 kWh
Example 5: reconstruction of the kWh- total meter
5
F0h
6
F1h
7
F2h
8
F3h
94h 59h FFh FFh
FF FF 59 94h = -42604
18
FDh
00h
Komentáře k této Příručce