User Manual

- 15 -
2) RUN_SINGLE_SHOT: Single measurement mode. After setting this mode, the
camera takes a measurement and then automatically switches to RUN_IDLE.
3) RUN_CONTINUOUS: Continuous measurement mode. After setting this mode,
the camera will automatically make continuous measurement until the user
manually sets it to RUN_IDLE or RUN_SINGLE_SHOT mode. In this mode, the data
will continuously output measurement data through RS485 or RS232.
2. The serial port receives the measurement data packet. For the format of the data packet,
please refer to the HPS-3D160 specification. Please follow the format definition to receive
the data packet. Refer to the following data receiving process to improve the system
according to its own platform:
1) Interrupt + timeout mechanism to receive measurement data
The advantage of this receiving mechanism is that no additional data buffer is needed, but there
may be frame dropping in environments with more peripheral interrupts, so this mechanism is
more suitable for low-load environments or RAM-tight platforms, with high memory space
utilization, but at the expense of time utilization.
2) Data asynchronous caching mechanism
This data receiving mechanism needs to open a data buffer separately for buffering data. The
circular FIFO can be used (the fifo module is provided by the SDK test program), which can greatly
alleviate the frame loss caused by receiving data for a relatively high load environment. The
Th e interrupt mechanis m
receives two bytes
The timeout mechanism
takes two length bytes
and converts them to
length L
Is it a 2-byte header?
The timeout mechanism
receives the remaining L
bytes of data
Use the API interface
HPS3D_MeasureDataParse() to parse the
data received
Y
N
Timeout
At the end of this
measurement