Root Cause and Solution
An on-site issue was found where even with identical parameter settings, some devices still experienced abnormal data acquisition. After debugging, the issue was confirmed to be related to the timeout configuration of the Mech-Eye API callback function.
When using the callback function to retrieve data, the API program waits for the data to return within a specified timeout period. An overly short timeout may interrupt data acquisition or transmission.
You can fix this issue by increasing the CallbackRetrievalTimeout parameter in your program.
Below is a C++ example:
// Set a longer CallbackRetrievalTimeout (unit: ms)
showError(profiler.currentUserSet().setIntValue(
mmind::eye::scan_settings::CallbackRetrievalTimeout::name, 60000));
The issue was resolved on-site after applying the above parameter setting.
Parameter Description: CallbackRetrievalTimeout
class CallbackRetrievalTimeout
{
public:
static constexpr const char* name = "CallbackRetrievalTimeout";
static constexpr const char* description =
"Set the timeout period for retrieving data when using a callback function. "
"If none or only some of the data is retrieved within the set timeout period, "
"the current round of data acquisition is automatically stopped. "
"The amount of data to be retrieved is determined by the 'ScanLineCount' parameter.\n"
"A value of 0 or -1 corresponds to an infinite timeout period.";
static constexpr Parameter::Type type = Parameter::Type::_Int;
static constexpr const char* unit = "ms";
};
Parameter details
Field | Description |
---|---|
name | Parameter name |
description | Timeout for data retrieval when using a callback function. If full data is not received within this period, the current round of acquisition stops automatically. |
type | Data type: integer (_Int ) |
unit | Unit: milliseconds (ms) |
Special values | 0 or -1 means infinite timeout |
Timeout Parameter Types
Two timeout parameters are provided, each controlling a different acquisition stage:
Type | Scope | Meaning | Configuration method |
---|---|---|---|
BatchRetrievalTimeout | Mech-Eye Viewer | Timeout interval for single profile acquisition | Set in Mech-Eye Viewer or in Mech-Eye API |
CallbackRetrievalTimeout | Mech-Eye API / Mech-MSR | Timeout interval for entire frame (all profiles) acquisition | Set via Mech-Eye API or in Mech-MSR |
① BatchRetrievalTimeout (Set in Mech-Eye Viewer)
You can set this parameter in Mech-Eye Viewer to define the maximum waiting time for each line scan.
Failure to complete a line scan within the timeout period triggers timeout warning or ends the current round of data acquisition.
(As shown below)
② CallbackRetrievalTimeout (Set via Mech-Eye API or in Mech-MSR )
This parameter defines the maximum waiting time for completing this round of data acquisition (i.e., acquiring all profile lines).
Failure to complete a round of data acquisition within the timeout period triggers termination of the current round of data acquisition.
Mech-Eye API example:
profiler.currentUserSet().setIntValue(
mmind::eye::scan_settings::CallbackRetrievalTimeout::name, 60000);
Mech-MSR example:
(As shown below)
Conclusion
- Root cause: The timeout set for the callback function was too short, leading to termination of a round of data acquisition.
- Solution: Increase the
CallbackRetrievalTimeout
parameter in Mech-Eye API or Mech-MSR according to actual site conditions. - Recommendation: For scenarios involving large FOV or high-resolution data acquisition, extend the timeout based on the scan line count (
ScanLineCount
), or set the timeout to infinite (-1
) to avoid termination of data acquisition.