execute
Each MERLIC tool requires a so called execute procedure. It represents the main procedure of the tool, i.e., the procedure that is created when implementing the custom tool as described in the topics of Implementing a Custom Tool with HALCON in HDevelop. Therefore, the name of the execute procedure represents the name of the custom tool. It is the only procedure that is obligatory when developing a tool since it includes the functionality of the tool.
It is also the procedure that is executed when the respective custom tool is used in a MERLIC Vision App. Therefore, we refer to this main procedure as the execute procedure of a tool.
Name
The name of the execute procedure must be identical to the name of the procedure library of the respective custom tool. Therefore, it represents the name of the tool.
Example
The example custom tool we created in the topic Implementing a Custom Tool with HALCON in HDevelop, has the name "Check_Wafer". The respective HDevelop procedure library is called "Check_Wafer.hdpl". Therefore, the name of the execute procedure is also "Check_Wafer".
Parameters
All parameters in the execute procedure will be transferred to the graphical user interface of MERLIC. Thus, the interface of the procedure defines the parameters and results of the tool. The input parameters of the procedure represent the tool parameters of the custom tool and the output parameters define the tool results of the custom tool. They can be specified in the procedure settings of the execute procedure as described in the topic Defining the Procedure Settings.
When using the custom tool in the MERLIC Creator, the parameters and results are visualized at the tool board and they can be adjusted and connected to other tools like any other tool parameters and result of standard MERLIC toools.
The parameter "ToolHandle" has an exceptional character because it is used only for internal purposes. Thus, it is not transferred to the graphical user interface of MERLIC.
Example
The following code block shows the execute procedure of the example custom tool "Check_Wafer" with its input and output parameters, i.e., the tool parameters and tool results of the custom tool.
Check_Wafer ( Image : Foreground, FinalRegion : ToolHandle, ROI, AlignmentData, Threshold : AreaHoles, Rectangularity, IsOkay )
The procedure defines the following input parameters, i.e., tool parameters:
- Image
- ToolHandle
- Threshold
- ROI
- AlignmentData
The output parameter, i.e., the tool results of the custom tools are the following:
- Foreground
- FinalRegion
- AreaHoles
- Rectangularity
- IsOkay