SABINE NAVIGATOR - SERIAL PROTOCOLS Manual - page 2
Page 2 of 6
There is no limit in the number of
256 readable ASCII bytes. When a
memory. However, it is not processed until a is received.
Format used for data values is readable ASCII (96 values for each character) unless specified otherwise.
Data Value
ASCII representation
0 0x20
:
:
95 0x7F
In other words, to send a data value of 0, send 0x20. To send a data value of 1, send 0x21, etc.
Checksum calculation:
1. Add up all of the bytes from the first (0x01) to the last byte before the check sum.
2. AND this result with 0xFF
3. Take the modulus this result with a base of 0x60 (hex 60 or decimal 96)
4. Add 0x20 to this value to get the ASCII representation
5. Use the hex value of this result for the check sum
Checksum Example (in Hexadecimal)
The string below mutes output 3. 0x53 is the checksum.
53
>
1. Adding up all the bytes from 0x01 to 0x1F, the raw hex checksum is 0x2F3.
2. AND 0x2F3 with 0xFF: 0x2F3 AND 0xFF = 0xF3
3. Now take the modulus base 0x60: 0xF3 MOD 0x60 = 0x33.
4. Add 0x20 to 0x33 for the ASCII representation: 0x20+0x33=0x53. So the checksum is
0x53
.
Another Example:
To set the gain to 0dB on input 1, device 1, the string would be (in HEX):
1
is the start byte
25
means a write command follows
7F
means the command came from the PC
3
means the commmand that follows is 4 bytes long
4C 56 4C 30
is ASCII for "LVL0", the signal level (gain) command code