Skip to main content
Associate II
September 12, 2025
Solved

[VL53L8CH] Switch between different ranging modes

  • September 12, 2025
  • 1 reply
  • 1191 views

Dear ST,

The VL53L8CH's example codes have demonstrated how the sensor can be controlled through set of APIs. However I am still not very sure about how can I switch between different working modes on-the-fly during runtime.

For example, assume I have set the sensor to work under CNH output mode, by using API from cnh_plugin

vl53lmz_cnh_init_config () and then vl53lmz_start_ranging ().

Then I need to change the mode back to basic ranging mode, i.e., I do not need CNH data output anymore, just want default data output. What should I do to cancel it? Do I just have to 

vl53lmz_stop_ranging (), and vl53lmz_start_ranging () again? 

Similar question exists for other modes like when working under motion indicator mode, and then again I need to switch to basic ranging mode (without CNH data or other plugins, etc.).

I did not find a clear answer from the examples provided. Your hints will be appreciated.

/Roland

 

 

 

 

Best answer by RogerM

Hi,
Sorry, the VL53L5/7/8 sensors don't support dynamic changes of output data while ranging.
To enable / disable CNH output you will have to stop ranging, modify the blocks of data you wish to receive from the senosr using the vl53lmz_add_output_block()/vl53lmz_disable_output_block() functions then restart the sensor using vl53lmz_send_output_config_and_start(). If you just want to disable CNH output you shouldn't need to reconfigure other CNH settings (you can leave it configured but not uploading data to the host). But if you need to switch between Motion Indicator operation and CNH output you would have to do more reconfiguration due to the fact that configuration space and processing is common between them in the sensor firmware.
Hope this helps.
Roger

1 reply

RogerMBest answer
ST Employee
September 15, 2025

Hi,
Sorry, the VL53L5/7/8 sensors don't support dynamic changes of output data while ranging.
To enable / disable CNH output you will have to stop ranging, modify the blocks of data you wish to receive from the senosr using the vl53lmz_add_output_block()/vl53lmz_disable_output_block() functions then restart the sensor using vl53lmz_send_output_config_and_start(). If you just want to disable CNH output you shouldn't need to reconfigure other CNH settings (you can leave it configured but not uploading data to the host). But if you need to switch between Motion Indicator operation and CNH output you would have to do more reconfiguration due to the fact that configuration space and processing is common between them in the sensor firmware.
Hope this helps.
Roger

RolandashAuthor
Associate II
September 18, 2025

Thank you Roger, for the detailed information.