Single Round of Data Acquisition: Software + Encoder
This topic introduces how to trigger multiple rounds of data acquisition and retrieve the profile data with the trigger_with_software_and_encoder sample on Windows.
Please refer to Usage Guide for HALCON Samples to obtain the samples and check the prerequisites for using the samples. |
Acquire Data
This sample uses the software + encoder method to trigger data acquisition.
|
Please follow these steps to acquire data:
-
Open the sample in HDevelop: Open HDevelop, and drag the sample into HDevelop.
-
Adjust the encoder-related parameters: Refer to the instructions in Adjust Parameters and adjust the following encoder-related parameters according to your actual needs:
-
EncoderDivider
-
EncoderOutputMode
-
EncoderTriggerSignalCountingMode
You can also refer to Laser Profiler Parameters Available in GenICam Client and check the parameter descriptions and more information provided in Mech-Eye Viewer Parameter Reference.
-
-
Step over the program (click the button in the toolbar repeatedly), until the Variable Inspect: MechEyeProfilerInfos window pops up.
-
This window displays all the available laser profilers. Double-click the laser profiler that you want to connect, and copy the name after unique_name: or user_name:.
user_name is the custom laser profiler name. You can customize the camera name in Mech-Eye Viewer. -
Locate the following line, and replace LNX with the copied unique_name or user_name.
DeviceInfo := 'LNX'
-
Run the sample by clicking in the toolbar or pressing the F5 key.
-
View the acquired intensity image and depth map data in the following variables:
-
reflectance: intensity image
-
depthInMM: depth map
-
Adjust Parameters
If the quality of the obtained data is unsatisfactory, you can adjust the corresponding parameters..
|
To adjust the parameters, follow these steps:
-
Use the following operator to obtain the list of available parameter groups on the laser profiler.
get_framegrabber_param (AcqHandle, 'UserSetSelector_values', ParameterGroupNames)
-
View the list of parameter groups in the ParameterGroupNames variable in the Control Variables area.
-
Use the following operator to select the parameter group to modify. UserSetSelector and UserSetLoad are the laser profiler parameters used to select and load a parameter group, respectively. Replace ParameterGroupName with the actual parameter group name.
The parameter group name displayed in HDevelop corresponds to the order of parameter groups in Mech-Eye Viewer. For example, UserSet0 in HDevelop is the first parameter group in Mech-Eye Viewer. For details, refer to Select Parameter Group in HALCON. set_framegrabber_param (AcqHandle, 'UserSetSelector','ParameterGroupName') set_framegrabber_param (AcqHandle, 'UserSetLoad','ParameterGroupName')
-
Use the following operator to obtain the value of a specific parameter. Replace ParameterName with the actual name of the laser profiler parameter. The parameter value is saved in the ParameterValues variable. You can change the variable name according to actual needs. Note that this variable does not need to be included in parentheses.
get_framegrabber_param (AcqHandle, 'ParameterName', ParameterValues)
-
View the parameter value in the ParameterValues variable in the Control Variables area.
-
Use the following operator to adjust the value of the specified parameter. Replace ParameterName with the actual name of the laser profiler parameter and NewParameterValue with the new parameter value.
set_framegrabber_param (AcqHandle, 'ParameterName', 'NewParameterValue')
-
Use the following operator to save the parameter value modification into the parameter group. UserSetSave is the laser profiler parameter used to save the parameter group. Replace ParameterGroupName with the actual parameter group name.
set_framegrabber_param (AcqHandle, 'UserSetSave', 'ParameterGroupName')
References
-
The parameters available in GenICam clients generally correspond with those available in Mech-Eye Viewer. For the detailed correspondence, refer to Laser Profiler Parameters Available in GenICam Client.
-
Adjusting parameters such as Correction and Mask usually requires the assistance of visualized tools for several rounds of fine tuning. Since GenICam clients does not provide visualized tools, you can adjust these parameters using the visualized tools provided by Mech-Eye Viewer. For details, refer to Adjust Laser Profiler Parameters Using Mech-Eye Viewer.
You must disconnect from the laser profiler in HDevelop before you can connect to it in Mech-Eye Viewer. If you fail to connect the laser profiler in Mech-Eye Viewer, close HDevelop and try again.