EasyManua.ls Logo

Sfere DGN175 U - Page 30

Sfere DGN175 U
30 pages
Print Icon
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Measure = byte 3 x 256
3
+ byte 4 x 256
2
+ byte 1 x 256 + byte 2
= 0 x 256
3
+ 0 x 256
2
+ 19 x 256 + 136
= 5000
Reading of the address 120 => decimal point = 2 => displayed measure: 50.00
Response with a negative measure:
measure
Value of the measure:
Sign: 1 negative: reversing of the bits and plus 1.
Reversion
Plus 1
0 0 19 136
Measure = -(byte 3 x 256
3
+ byte 4 x 256
2
+ byte 1 x 256 + byte 2)
= -(0 x 256
3
+ 0 x 256
2
+ 19 x 256 + 136)
= -5000
Reading of the address 120 => decimal point = 2
=> displayed measure -50.00
254
3
4
236
120
255
255
CRC 16
byte 3 byte 4 byte 1 byte 2
byte 3 byte 4 byte 1 byte 2
byte 3 byte 4 byte 1 byte 2
Carry
Next byte
Yes
Yes
No
No
p29
byte 1 byte 2 byte 3 byte 4 2 bytes
11111111
11111111
111 0 11 0 0
0 1111 0 0 0
1 0 0 0 0 111
8.5 CRC16 calculation algorythm:
FFFF CRC
CRC
BYTE CRC
n = 0
Shifting by 1 bit to the
right of CRC
CRC
POLY CRC
n = n + 1
n > 7
End of sequence
END
Yes
No
Note: = exclusive or.
Note 2: POLY = A001 (hex).
Note 3:
The CRC 16 calculation applies to all bytes in the sequence (excluding CRC16).
Note 4:
Caution! In the CRC 16, the 1st sent byte is the LSB.
Example: Sequence 1-3-0-75-0-2 CRC16 = 180-29 (the values are decimal).