ML-x17 DATA LOGGER MANUAL
Manufacturers of low power instruments
page 111
4.44.1 Records
A record can have a length from one to 6 bytes.
4.44.1.1
First byte of record
Bit 7
6
5
4
3
2
1
0
Type of record
Sign bit
Scaling bits
The most significant nibble of the first byte describes the type of record, the least significant nibble its
scaling and sign. See paragraphs “Time/Value-record” for more details.
The first byte is
followed by 0 or up to 5 “number”-bytes.
4.44.1.2
Number-bytes
The
“number”-bytes form an unsigned integer (mantissa), which can be converted to a real number by
applying the scaling and sign.
Bit 7
6
5
4
3
2
1
0
Following byte bit
7-bits value * 2
0
(0 to 127)
Bit 7
6
5
4
3
2
1
0
Following byte bit
7-bits value * 2
7
(128 to 16383)
Bit 7
6
5
4
3
2
1
0
Following byte bit
7-bits value * 2
14
Bit 7
6
5
4
3
2
1
0
Following byte bit
7-bits value * 2
21
Bit 7
6
5
4
3
2
1
0
0 7-bits value * 2
28
Each “number” byte contains a 7-bits value (0 to 127) and a bit to indicate that another “Number” byte is
following or not
. If “1” then another 7-bits value is following, which should be multiplied by 128 (2
7
) and
added up to the first byte, if there is a next byte it should be multiplied by 16384 (2
14
) etc, etc., until the
“following byte” bit is set to “0”. When the “following byte” bit is “0”, then a next record starts unless the
end of message is reached.
Number examples:
•
0
0000001 = 1
•
1
0000001
0
0000010 = 1 + (2*128) = 257
•
1
0000001
1
0000010
0
0000011 = 1+(2*128)+(3*16384) = 49409
•
1
0000001
1
0000010
1
0000011
0
0000100 = 1+(2*128)+(3*16438)+(4*2097152) = 8438017