
LeveLine
®
Instruction Manual
10401-01026 Rev D
6.9. SDI-12 Cyclic Redundancy Check
The cyclic redundancy check included in responses to the Send Data command is
calculated on the contents of the response, starting with the sensor address character and
ending with the last response character before the start of the CRC field.
The CRC field is composed of three characters in the range 0x40-0x7F, which encode the
16-bit CRC value as follows:
1
st
character: binary 0100C
15
C
14
C
13
C
12
2
nd
character:binary 01C
11
C
10
C
9
C
8
C
7
C
6
3
rd
character: binary 01C
5
C
4
C
3
C
2
C
1
C
0
where C
n
is the
n
th bit of the CRC.
The algorithm for calculating the CRC is as follows:
Set crc = 0
For each message character c:
Set crc = crc XOR c
Repeat 8 times:
If least significant bit of crc is 1,
Shift crc right by one bit
Set crc = crc XOR 0xA001
Otherwise,
Shift crc right by one bit
© 2019 Aquaread
®
Ltd.
www.aquaread.com
Page 75 of 90