L
aser distance sensor user manual
- 5 -
5. Inputs and Outputs
5.1 Communication Setting
Baud rate: 9600 bps,
Parity bit: None,
Data bits: 8, Stop bit:1
5.2 Input data format
There is only one byte in each input data pack. Users could send different
commands to the sensor for different purpose, the functions of command are
shown in the following table.
HEX
0X4F
0X43
0X55
ASCII(Capital
letter)
O
C
U
Functions of
command
Power On &
Trigger Measuring
Continuous
Measuring
Power Off
5.3 Output data format
Digital output data is displayed by ASCII code, there is 7 bytes in every data frame.
The frame header is 0XFF, the next bytes meant measured distance numbers (unit:
mm). A:
hundreds of thousands
, B:
tens of thousands
, C:
thousands
, D:
hundreds
,
E:
tens
, F:
ones
.(Notice: If any byte in a data frame is not used, the sensor will
return 0X20 in that byte.)
Header
A
B
C
D
E
F
0XFF
hundreds of
thousands
tens of
thousands
thousands
hundred
s
tens
ones
The mapping table of HEX and number codes:
HEX
0X30
0X31
0X32
0X33
0X34
。。。 0X37
0X38
0X39
0x2D
0X20
number
0
1
2
3
4
。。。
7
8
9
-
space
For example, if the measured distance data is 3456mm, then the sensor willreturn
data as" 3456"(HEX: FF 20 20 33 34 35 36).
Or the measured distance data is 123456mm, then the sensor will return data as
"123456"(HEX: FF 31 32 33 34 35 36).
If the sensor couldn’t get any available data( out of measurement range or
measured in blind zone), it will return “ - - - -”(HEX:FF 20 2D 2D 2D 2D 20) to
the computer.