Mantracourt Electronics Limited
T24 Technical Manual
77
Data Type Formats
The following data formats are used when communicating with the base station. These formats apply to the raw
data in the packets and also to the data parts of the Mantracourt supplied T24drv.dll driver.
Value
Data Type
Number Of Bytes
Example
Notes
1
UINT8
1
01
2
UINT16
2
00 01
MSB First
3
INT32
4
00 00 00 01
MSB First
4
Float
4
3F 80 00 00
See Floating Point IEEE
5
String
0-64
Hello World
6
Binary
0-64
"£$%^&*(
UINT8
Represents an unsigned numeric value from 0 to 255 and consists of a single byte.
Byte
7 6 5 4 3 2 1 0
UINT16
Represents an unsigned numeric value from 0 to 65535 and consists of 2 bytes. The bytes are in order of
significance MSB first.
MSByte
LSByte
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
INT32
Represents a signed numeric value from -2,147,483,648 to positive 2,147,483,647 and consists of 4 bytes and is
stored in 2's compliment form. The bytes are in order of significance MSB first.
MSByte
LSByte
31
30
29
28
27
26
25
24
23
22
21
20
19
18
16
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Sign Bit
Float
Represents a numeric value from n to n and consists of a 4 byte in IEEE 754 format.
MSByte
LSByte
31
30
29
28
27
26
25
24
23
22
21
20
19
18
16
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Exponent (7-bit excess-127)
Mantissa (-bit fraction with implicit 1)
Sign Bit
The byte containing the sign and exponent is sent first, with the LS byte of the mantissa being last.
The value of the number is thus
(-1)Sign * 2(Exponent-127) * 1.Mantissa
Note the ‘assumed 1’ before the mantissa. The exception to this is the special value 0.0, which is represented as
4 zeroes.
The precision of this format is to 7 digits.
eg. a floating-point number of -12345.678 is represented as – [hex] C640E6B6
String
Represents a textual string and is terminated by a NULL (ASCII 0).
Binary
The bytes have no set meaning and are just a string of bytes. These bytes can be any value and may contain non
ASCII characters.