Description

LumiScan Script Runner turns HALCON procedures into functions on the Data Layer. It is meant for vision experts who write their own HALCON code for demanding edge cases and want to call it from a PLC or any other Data Layer client, without writing glue code. Customers who want to solve a vision task without vision knowledge use the other apps of the LumiScan Vision Suite.

How it works

  1. You write a procedure. In HDevelop you write and test a procedure with a declared interface: image inputs, image outputs, value (control) inputs and value outputs. The types of the parameters come from the procedure’s documentation or from an interface file next to it.

  2. You put it into the script folder. The procedure file (<name>.hdvp) goes into the Script Runner’s script folder, see Settings Folder.

  3. You configure a module. An entry in the application file names the module, the procedure it runs, its group and where each parameter comes from or goes to.

  4. The Script Runner builds the nodes. At start it reads every procedure of the script folder through HDevEngine, maps each parameter to a node (see Type Mapping) and publishes the module under hdvisionsystems/lumiscan-script-runner/v1/<module>/.

  5. A client calls the module. It writes the inputs, raises run/request and waits for run/done or run/has-error, see The run Handshake. The Script Runner runs the procedure, checks every output against the interface and writes the outputs.

What you get

  • Typed nodes from your interface. An integer parameter becomes an INT64 node, a real parameter a FLOAT64 node, a string a STRING node, several values an array node, an image a group with data, width, height and pixel-type. Descriptions, units, minimum, maximum and default values of the procedure go into the node’s description, and the minimum and maximum are checked before the procedure runs.

  • One handshake for every script. Every module has the same run function (request, ready, running, done, has-error, output/status-code). One PLC function block with xExecute, xBusy, xDone, xError and eErrorID serves every module; only the input and output nodes differ.

  • Shared models without handles on the Data Layer. A HALCON handle (a shape model, a dictionary) never leaves the app. Modules that share a handle run in one group and pass it through the group’s store, see Modules, Groups and the Store. A module can run once at start, for example to read a model file.

  • Protection for your PLC program. The Script Runner computes a hash of every procedure’s interface. A module is built only when the hash is the one it was accepted for, so a changed procedure never moves your PLC program’s nodes unnoticed, see Interfaces and Hashes.

  • Changes without a new build. Replace a procedure whose interface stays the same and restart the app: the new vision logic runs behind the same nodes.

  • Protected procedures. A procedure locked with a password in HDevelop runs as well; its interface stays readable. The password never reaches the device.

What it does not do

  • It runs procedures, not HDevelop programs (.hdev) with a main: wrap a program into a procedure first, see Prepare a HALCON Procedure.

  • Regions and contours (XLD) are not transported on the Data Layer. Convert them into an image (region_to_bin, paint_xld) or into coordinate arrays before the procedure returns.

  • A parameter that mixes strings and numbers in one tuple is not supported.

  • The procedure has no timeout: the client times out on its side.

The limits of this version are listed in the Release Notes.