RESI®
Title:
RESI-KNX-xxx manual
Date
Page
of
12.12.2018
48
60
.
P
ro
p
ri
e
ta
ry
d
a
ta
,
co
m
p
a
n
y
co
n
fid
e
n
tia
l.
A
ll
r
ig
h
ts
re
se
rv
e
d
.
C
o
n
fié
à
tit
re
d
e
se
c
re
t
d
'e
n
tr
e
p
ri
s
e
.
T
o
u
s
d
ro
its
r
é
se
rv
é
s
.
C
o
m
u
n
ic
a
d
o
c
o
m
o
se
g
re
d
o
e
m
p
re
sa
ri
a
l.
R
e
se
rv
a
d
o
s
to
d
o
s
o
s
d
ir
e
ito
s.
C
o
n
fid
a
d
o
co
m
o
s
e
cr
e
to
i
nd
u
st
ri
a
l.
N
o
s
re
se
rv
a
m
o
s
t
o
d
o
s
l
o
s
d
e
re
c
ho
s.
.
.
W
e
it
e
rg
a
b
e
s
o
w
ie
V
e
r
v
ie
lf
ä
lt
ig
u
n
g
d
ie
s
e
r
U
n
te
rl
a
g
e
,
V
e
r-
w
e
rt
u
n
g
u
n
d
M
it
te
ilu
n
g
ih
re
s
In
h
a
lt
s
n
ic
h
t
g
e
s
ta
tt
e
t,
s
o
w
e
it
n
ic
h
t
a
u
s
d
r
ü
c
k
lic
h
z
u
g
e
s
ta
n
d
e
n
.
Z
u
w
id
e
rh
a
n
d
lu
n
g
e
n
v
e
r-
p
fl
ic
h
te
n
z
u
S
c
h
a
d
e
n
e
rs
a
tz
.
A
ll
e
R
e
c
h
te
v
o
rb
e
h
a
lt
e
n
,
in
s
b
e
-
s
o
n
d
e
re
fü
r
d
e
n
F
a
ll
d
e
r
P
a
te
n
te
rt
e
il
u
n
g
o
d
e
r
G
M
-E
in
tr
a
g
u
n
g
.
.
Now we show a common pitfall in writing and reading more than one MODBUS register and rebuilding a value.
We use a different float value. In hexadecimal it is 0x41BC41BB. Again we use the online converter:
You notice, the float value is 23.532095.
Now we store it with HIGH word first into two registers:
But now we make a very big mistake, we read the two registers and restore the hexadecimal value in our host
software in the reverse word order. First low word, then high word. The result is the 32 bit value 0x41BB41BC
instead the correct value 0x41BC41BB. Then we convert this into an IEE754 float value.
The result is 23.407097. This is not far away from the original number of 23.532095! So this massive software
error can be undiscovered for a long time. Only if the reverse float value generates numbers which are
physically not possible for the measured signal, this error is discovered!
MODBUS
Register
Storage of FLOAT32 datatype
4x00010
I:9
HIGH WORD
The high word of the 32 bit float value 0x41BC41BB is stored in the first 16 bit
wide MODBUS register. This means the value 0x41BC is stored here.
4x00011
I:10
LOW WORD
The low word of the 32 bit float value 0x41BC41BB is stored in the second 16 bit
wide MODBUS register. This means the value 0x41BB is stored here.