S
ENSOR
C
OMMANDS AND
R
ESPONSES
Copyright LMI Technologies Inc. 2003
17
Packet example
To request the Start scan from the sensor, the host computer program should send the following message
packet:
If using Checksum
02
Address
1
3
Checksum
(1Byte)
STX Character
Device Address
Command Size
Command (Start
scan)
Lets assume that sensor has serial address of 1;
Example 1
Start scan (command 3) :
$02 + $01 + $01 + $03 + $F9
where Length = 1 (1 command byte)
The validity of the data in all packets transmitted to and from the sensor is checked using the last byte of the
packet
–
checksum (
“
2
’
s complement of the sum of all bytes in the packet)
02+01+01+03 = 07
256-07 = 249
Checksum is 249 = $F9
Example 2
Set Scan Interval (command 5 ) Let set interval to 400 ( $0190)
$02 + $01 + $03 + $05 +$90 + $01 +$64
where Length = 3 ( 1 command byte + 2 data bytes)
02+01+03+05+144+01= 156
256-156=100
Checksum is 100 =$64
Example 3
Set Scan Filters ( command 14 ($0E )) : Let set Dropout factor t 15 ($000F);
Smooth to 75 ($004B) and Order to 5 ($0005)