Troubleshooting
This page describes problems of LumiScan Script Runner. Start with the general checks, then find your symptom below: each problem lists its symptoms, the possible causes, a diagnostic procedure and the resolution. The status codes are listed in Status Codes.
General checks
-
Check the app. Read
hdvisionsystems/lumiscan-script-runner/v1/system/status-text. Expected:Initialized. -
Check HALCON. Read
v1/system/engine/license-validandv1/system/engine/version. Expected:trueand the HALCON version. -
Check the module. Read
v1/<module>/status/codeandstatus/text. Expected:0andready. -
Check the last run. Read
v1/<module>/run/output/status-codeandstatus-text. Expected:0. -
Read the log. The Script Runner writes its log to its console window. At start it names the script folder, every procedure it loaded with its interface hash, every module with its group, and every module it did not build, with the reason.
The settings folder is listed under Settings Folder.
Installation
Problem: The installer says HALCON was not found
The installer stops before installing anything with the message LumiScan Script Runner needs MVTec HALCON 22.11 (Steady) with a runtime licence, and HALCON was not found. The message continues with one of two reasons: the system environment variable HALCONROOT is not set, or no bin\x64-win64\halcon.dll in the HALCONROOT folder.
-
HALCON is not installed.
-
HALCON was installed for the current user only. That sets
HALCONROOTas a user variable, and the installer reads only the system variable. -
HALCONROOTnames a folder withoutbin\x64-win64\halcon.dll, for example after HALCON was moved or partly uninstalled, or it is the 32-bit or another platform’s installation.
-
Open Edit the system environment variables in Windows, then Environment Variables. Look for
HALCONROOTunder System variables (not under the user variables). -
Check that
bin\x64-win64\halcon.dllexists in the folder it names, for exampleC:\Program Files\MVTec\HALCON-22.11-Steady\bin\x64-win64\halcon.dll. -
If needed, read the installer’s log: it is written to the
%TEMP%folder asLumiScan_Script_Runner_<date and time>.log, and the linesFile searchandConditionshow what was looked for.
-
If HALCON is missing, or installed for one user only: install HALCON 22.11 for all users, sign out and in again, and run the Script Runner installer again.
-
If the folder is wrong: repair the HALCON installation so that
HALCONROOTnames it andhalcon.dllis there.
Send the installer’s log and the information listed under Information for support to support.
Start
Problem: The app stops right after it starts
The console window shows an error and closes, or no node appears under hdvisionsystems/lumiscan-script-runner.
-
The application file is not valid JSON, or a setting is refused:
apiVersionis not1,scriptFolderis empty,engine.threadNumis not a whole number from 0 to 1024, a module entry is refused, or two modules have the same name. See Application File, section Checks at start. -
The app cannot reach LumiScan Keryx.
-
HDevEngine cannot be set up, for example because HALCON is not installed or its library folder is not on
PATH(Windows) orLD_LIBRARY_PATH(Ubuntu). -
HALCON of another release than 22.11 is loaded, see Problem: The app stops with "HALCON of another release is loaded".
-
Start the app from a command prompt (Windows:
lumiscan-script-runner.exein its installation folder) or a terminal (Ubuntu:lumiscan-script-runner) to keep the log on screen. -
Look for lines starting with
[ScriptRunner] Cannot start,HDevEngine cannot be set upor an error about the Data Layer connection. A refused module entry is logged asmodule <name>: …. -
Open
lumiscan-script-runner.jsonin an editor that checks it against its schema, for example Visual Studio Code.
-
If the application file is refused: correct the setting the log names, see Application File. If in doubt, rename the file: the next start copies the shipped default.
-
If LumiScan Keryx is not reachable: start LumiScan Keryx first, or give the broker with
--keryx-url. -
If HDevEngine cannot be set up: install HALCON 22.11. On Windows, check
%HALCONROOT%\bin\x64-win64\halcon.dll, and sign in again so thatPATHis updated. On Ubuntu, check$HALCONROOT/lib/x64-linux/libhalcon.so, and thatLD_LIBRARY_PATHnames its folder in the terminal that starts the app.
Send the information listed under Information for support to support.
Problem: The app stops with "HALCON of another release is loaded"
The app stops right after it starts. The log has a line starting with [ScriptRunner] HDevEngine cannot be set up: HALCON of another release is loaded:, followed by each HALCON library of the wrong release with its version and folder, for example halcon.dll 24.11.1.0 (C:\Program Files\MVTec\HALCON-24.11-Steady\bin\x64-win64\halcon.dll). On Ubuntu the libraries are libhalcon.so, libhalconcpp.so and libhdevenginecpp.so.
-
Only another HALCON release is installed, for example 24.11 instead of 22.11.
-
HALCON 22.11 and another release are both installed, and the other release’s library folder comes first:
bin\x64-win64onPATH(Windows),lib/x64-linuxonLD_LIBRARY_PATH(Ubuntu). -
A HALCON library of another release was copied into the Script Runner’s installation folder.
-
Read the folders the log line names: they show which HALCON installation was used.
-
On Windows, run
where halcon.dllin a command prompt: the first line is the library the Script Runner loads. On Ubuntu, runecho $LD_LIBRARY_PATHin the terminal that starts the app: the first HALCON folder in it is the one the Script Runner uses. -
Check
HALCONROOT: on Windows under the System variables, on Ubuntu withecho $HALCONROOT. It should name the HALCON 22.11 folder.
-
If HALCON 22.11 is not installed: install it, with a licence valid for 22.11 (on Windows for all users). It can stay installed next to the other release.
-
If another release comes first: on Windows, move
%HALCONROOT%\bin\x64-win64of HALCON 22.11 above the other release’s folder in the system variablePATH, or remove the other folder fromPATH. On Ubuntu, put$HALCONROOT/lib/x64-linuxof HALCON 22.11 before the other release’s folder inLD_LIBRARY_PATH, for example in~/.profile. Sign out and in again, then start the app. -
If a HALCON library is in the installation folder: delete it there; the Script Runner never ships HALCON’s libraries.
-
If you have to use the newer HALCON release: you need a version of the Script Runner built for it. Contact HD Vision Systems.
Send the log line and the information listed under Information for support to support.
Problem: Every module reports -4
v1/<module>/status/code is -4 for every module. v1/system/engine/license-valid is false; v1/system/status-text says the HALCON licence is not valid: ….
-
No valid HALCON runtime licence on the PC: the HALCON dongle is not plugged in, or the licence file is missing or expired.
-
The HALCON dongle was pulled while the app ran. HALCON notices it after 2 to 4 minutes; from then on runs fail with
-4.
-
Read
v1/system/licenses/current/error-text. It holds HALCON’s own licence message. -
Read
v1/system/licenses/current/fileandhost-id: the licence file HALCON chose and the PC or dongle it is bound to.v1/system/licenses/fileslists every licence file HALCON found. -
Check that the HALCON dongle is plugged in, or that the licence file is in HALCON’s licence folder.
-
Plug in the HALCON dongle or install the licence file, then restart the app. The Script Runner checks HALCON’s licence at start; after a licence error it reports
-4until it is restarted.
Send the information listed under Information for support to support, together with v1/system/status-text. For licences, contact licenses@hdvisionsystems.com.
Problem: One module reports -4, the others run
v1/<module>/status/code is -4 for one module; status/text names a HALCON module, for example matching.
-
The procedure needs a HALCON module that the HALCON licence does not cover. The modules it needs come from
requiredModulesof its interface file.
-
Read
v1/system/engine/licensed-modules. Expected: it contains the module named instatus/text.
-
Extend the HALCON licence, or change the procedure so that it does without the module. If
requiredModulesin the interface file lists a module the procedure does not really need, correct the list and restart the app.
Send the information listed under Information for support to support, together with v1/system/engine/licensed-modules and the interface file.
Modules
Problem: A module reports -10002 (script not loaded)
v1/<module>/status/code is -10002; the module has no input or output nodes.
-
No procedure file of that name in the script folder (
procedurenames the file without.hdvp). -
HDevEngine cannot load the procedure, for example because it was saved with a newer HALCON version.
-
A parameter has no type: neither the documentation nor an interface file gives one.
-
The interface file does not fit the procedure: a parameter is missing on one side, renamed, in another group or of another dimension.
-
A parameter cannot be on a node: a handle input without a store binding, a region or contour input, a vector, or strings mixed with numbers.
-
A binding names a parameter the procedure does not have, binds it in the wrong direction, or gives an image, a handle or a value that does not fit a fixed value.
-
Two parameters give the same node name, or an output gives a reserved name (
status-code,status-text,package-identifier). -
The module is a
startmodule, and its run failed.
-
Read
v1/<module>/status/text. It names the parameter and the reason. -
Read
v1/system/scripts. Expected: the procedure is listed withouterror. -
Read the log of the start: it lists every warning and refusal per parameter.
-
If the procedure is missing: copy it into the script folder, or correct
procedurein the application file. -
If a parameter has no type: document it in HDevelop or add it to the interface file, see Prepare a HALCON Procedure.
-
If the interface file does not fit: correct it, see Interface File.
-
If a parameter cannot be on a node: bind it to the store or a fixed value, or change the procedure, see Type Mapping.
-
If a start run failed: the text gives the HALCON error; correct the procedure or the file it reads.
Then restart the app. Expected: status/code is -10005 (for a new module) or 0.
Send the information listed under Information for support to support, together with status/text, the procedure and its interface file.
Problem: A module reports -10005 (interface changed)
v1/<module>/status/code is -10005; the module has no input or output nodes and accepts no request. status/text says that the module has no accepted interface hash, or that the procedure’s interface changed (accepted sha256:…, now sha256:…).
-
The module is new and has no
acceptedInterfaceHashyet. -
The procedure or its interface file was replaced, and a parameter was added, removed, renamed, moved to another group or retyped.
-
Read
v1/<module>/status/text. It gives the accepted and the current hash. -
Compare
v1/<module>/script/interfacewith the interface your PLC program expects.
-
If the change is wanted: adapt your PLC program, copy
v1/<module>/script/interface-hashintoacceptedInterfaceHashand restart the app. See Add a Module and Replace a Script. For a procedure whose types come from an interface file,interface-savesets the hash for you, see Building one over the Data Layer. -
If the change is not wanted: put the previous procedure back into the script folder and restart the app.
Send the information listed under Information for support to support, together with status/text and script/interface.
Problem: Every module reports -5 (restart required)
v1/system/restart-required is true; every module reports -5, and no request is accepted.
-
v1/system/settingswas written. The new settings are saved, and take effect at the next start. -
An interface file was saved with
interface-save. The app loads it at the next start.
-
Restart the app.
Runs
Problem: The module does not react to request
run/request is true, but run/running stays false.
-
run/readywasfalsewhenrequestrose: the module is not built, a restart is pending, a run is still going on, orrequestwas not lowered after the previous run. -
requestwas alreadytrueand was not lowered after the previous run: the run starts on the rising edge only.
-
Read
run/readyandstatus/codeof the module. -
Check that your program lowers
requestafter every run and waits forreadybefore it raises it again.
-
If
status/codeis not0: follow the entry for that code. -
If
requestwas not lowered: lower it, wait forready, raise it again. See The run Handshake.
Problem: A run ends with -3 (invalid input)
has-error is true; run/output/status-code is -3. The procedure did not run.
-
A number is outside the parameter’s min and max.
-
An input image has an unknown pixel type, width or height 0, a
datasize that does not match width × height × bytes per pixel, or a pixel type or channel count the parameter does not accept. -
A handle taken from the group’s store is no longer valid, or of another kind than the interface declares.
-
Read
run/output/status-text. It names the input and the reason. -
For a number, read the node’s description: it ends with min and max.
-
For an image, compare
pixel-type,width,heightand the size ofdata.
-
Correct the input and run again. For a handle, run the module that writes the store key again (or restart the app to rerun the
startmodules).
Send the information listed under Information for support to support, together with status-text and the input values.
Problem: A run ends with -10001 (script error)
has-error is true; run/output/status-code is -10001.
-
The procedure raised an error with
throw. -
A HALCON operator failed inside the procedure, for example because a file is missing or an input made no sense to it.
-
The procedure opened or asked for a window (
dev_open_window,dev_get_window): the Script Runner has no display.
-
Read
run/output/status-text. It names the procedure (or sub-procedure), the program line, the HALCON error number and the message. -
Run the procedure in HDevelop with the same inputs.
-
Correct the input or the procedure. Remove window operators from the procedure. A file the procedure reads must be in the script folder.
Send the information listed under Information for support to support, together with status-text, the input values and the procedure.
Problem: A run ends with -10003 (output type mismatch)
has-error is true; run/output/status-code is -10003. No output was written.
-
The procedure returned an output of another type than declared, for example a string for an integer, several values for a single-value parameter, or an image of a pixel type that is not carried.
-
The procedure did not set an output on the path it took.
-
Read
run/output/status-text. It names the parameter, the declared and the returned type.
-
Correct the procedure so that every output is set on every path and matches its declared type, or correct the declared type. For images, convert to
byteoruint2beforereturn ().
Send the information listed under Information for support to support, together with status-text and the procedure.
Problem: A run ends with -10004 (store value missing)
has-error is true; run/output/status-code is -10004.
-
The module that writes the store key has not run successfully yet: the
startmodule failed, or the handshake module that writes the key was not called. -
The writing module is in another group: each group has its own store.
-
The key names differ between the writing and the reading binding.
-
Read
run/output/status-text. It names the key and the modules that write it. -
Read
v1/system/groups. Expected: the key is listed in the group’s store. -
Compare
setting/groupandsetting/bindingsof both modules.
-
Run the writing module first, or correct the
startmodule (status/code-10002shows why it failed). -
Put both modules into the same group, and use the same key, see Share a Model Between Scripts.
Send the information listed under Information for support to support, together with status-text, v1/system/groups and the application file.
Problem: Runs are slow or wait long
running stays true much longer than the procedure needs in HDevelop.
-
Another module of the same group runs: requests in one group wait for each other.
-
HALCON may use one thread per operator only (
engine.threadNum1, the default). -
Large images: every image input and output is copied into and out of HALCON, for a 5-megapixel
rgb8frame about 13 to 27 ms per direction, see Copy time.
-
Read
setting/groupof the modules. Expected: only modules that share store keys are in one group. -
Compare the run time with the size and pixel type of the images the module takes and returns.
-
Put modules without shared state into groups of their own: they run in parallel.
-
If the PC has cores to spare, raise
engine.threadNum, or tryengine.jitCompiled. See engine. -
Pass only the images the procedure needs, prefer
mono8where it is enough, and leave an image output off the Data Layer ({"to": "none"}) when no client reads it.
Information for support
If a problem persists, send this information to support:
-
Software version: the version of LumiScan Script Runner, shown in the log at start (
Version: …), the HALCON version (v1/system/engine/version) and the licence in use (v1/system/licenses/current/file,type,host-id). -
Platform: Windows 11 or Ubuntu 24.04, and the exact version of the operating system.
-
Log: the console output of the app from its start to the error.
-
Time: the date and time of the error.
-
Communication status:
status/codeandstatus/textof the module,run/output/status-codeandrun/output/status-textof the last run, andv1/system/status-text. -
Files:
lumiscan-script-runner.jsonand the procedure with its interface file, if you may share them. A protected procedure is fine.
Contact HD Vision Systems customer success at customer.success@hdvisionsystems.com or +49 6221 6721905; for licences, licenses@hdvisionsystems.com.