Manual
LW20 / SF20 LiDAR sensor  
Product manual 
Appendix C :: Complete command set for machine-to-machine communications 
The LW20 has either a serial or an I2C communication port. Commands  can be  sent that  read values, change settings or alter the 
performance of the LW20. Distances are in meters and temperatures in degrees celsius. 
Commands are sent and responses received in ASCII format (human readable). These ASCII strings have a maximum of 32 characters. 
NOTE: There are some special commands to make the LW20 compatible with older systems and these are in binary format. 
Once a command has been sent a single reply will be returned. To continuously update the reply without re-sending the command 
the streaming ($) command can be used. 
!
Note 
The first command sent after power up will be used to detect if the LW20 is running in Serial or I2C mode, and therefore 
will not get a response. 
Command string format: 
  <command type><channel><parameter><index><,><numeric value><CR><LF> 
Command types: 
?  Read a value once. This can be either a result or a setting. 
#  Change a setting. All settings can be changed. 
$  Stream a value continuously. Update a result or a setting every time it changes. 
%  Save a setting. The setting becomes permanent even after the power is switched off. 
Channels: 
P Product channel - provides product specific information 
L  Laser channel - provides distance measurements and related settings 
S  Servo channel - relates to servo position and settings 
A Alarm channel - shows the status of alarms 
C  Communications channel - handles serial and I2C settings 
Examples: 
?LDF,0  Read the median value of the distance to the first return signal 
#LO,0.23 M o v e   t h e   m e a s u r e m e n t   z e r o   d a t u m   f u r t h e r   a w a y   b y   0 . 2 3   m e t e r s  
$1LT  Stream the internal temperature in the first column 
%P  Save all settings to permanent memory 
Command list 
Command
Typical return
Description
Product channel commands
? 
?P
p:SF20,1.0.0,11
Product name, firmware version, hardware version
?PN
pn:SF20
Product name
?PF
pf:11
Hardware version
?PS
ps:1.0.0
Firmware version
%P
%p:
Save all new settings to permanent memory
Laser channel commands
?L
?LD
l:3.35
ld,0:23.67
Default raw distance
Default median distance
?LDF
?LDF,0
?LDF,1
?LDF,2
?LDF,3
ldf,0:56.98
ldf,0:45.32
ldf,1:32.78
ldf,2:65.12
ldf,3:34.23
Median distance to the first return
Median distance to the first return
Raw distance to the first return
Closest distance to the first return
Furthest distance to the first return
?LDL
?LDL,0
?LDL,1
?LDL,2
?LDL,3
ldl,0:56.98
ldl,0:45.32
ldl,1:32.78
ldl,2:65.12
ldl,3:34.23
Median distance to the last return
Median distance to the last return
Raw distance to the last return
Closest distance to the last return
Furthest distance to the last return
LW20 / SF20  LiDAR - Product manual - Revision 9 |    of    | © LightWare Optoelectronics (Pty) Ltd, 2018 | www.lightware.co.za 24 28










