Creating an application with HALCON Script Engineπ
Preview restriction
HALCON Script Engine only supports C++ at the moment. Hence, only this language is described in the following.
At a glanceπ
The following settings are required for a project to use HALCON Script Engine:
- Include path:
%HALCONROOT%\include - Library path:
%HALCONROOT%\lib\%HALCONARCH%
(runtime libraries:hscriptenginecpp.dllandhalconcpp.dll) - Include file:
hscriptenginecpp\HScriptEngine.h - Link libraries:
hscriptenginecpp.libandhalconcpp.lib(as the API is based on HALCON/C++)
- Include path:
$HALCONROOT/include - Library path:
$HALCONROOT/lib/$HALCONARCH - Include file:
hscriptenginecpp/HScriptEngine.h - Link libraries:
libhscriptenginecpp.soandlibhalconcpp.so(as the API is based on HALCON/C++)
For the available classes and methods, see About the main classes and methods of HALCON Script Engine.
How to develop applications with HALCON Script Engineπ
With HALCON Script Engine, you can execute complete HALCON Script programs or individual procedures. Which way is better depends on the stage of development and on your task:
- When developing the image processing part of your application, you create a HALCON Script program. Thus, as a first test of your application, it is useful to execute the program via HALCON Script Engine. This test will already assure that the general configuration of your application (environment variables, procedure path, etc.) is correct. The HALCON Script Engine program itself should of course use the same procedures that you plan to execute from the programmed application.
- After you finished its development, you integrate the image processing part into your programmed application by executing the corresponding procedures. Typically, you display image processing results by using the methods of the underlying HALCON programming language interface (i.e., HALCON/C++ for HScriptEngine/C++), but you can also encapsulate recurring display tasks in HSCRIPT procedures.
Further, keep the following in mind:
- You can execute only procedures with public scope using the HALCON Script Engine. However, you can execute procedures with private scope either as part of a public procedure or an entire HALCON Script βmainβ program.
- All occurrences of the
stopoperator are ignored when executing a program using the HALCON Script Engine.
How to create an executable program with HScriptEngine/C++π
The general workflow to create an application with HScriptEngine/C++ is as follows:
-
In your application, include the main header file
HScriptEngine.hand use the corresponding namespaces: -
Compile the application using the following include paths:
-
Link the following libraries:
For more information, see the example project.