How to Run a HALCON Sample

Introduction

This tutorial shows how to configure HALCON samples and run them in HDevelop, C++, and C#.

Requirements

Required

Note

The HALCON version tested with Zivid cameras is 19.05 Progress, 20.05 Progress, 21.11 Progress.

Optional

  • If you do not currently have a separate ply viewer installed, MeshLab is a straightforward option to see the point clouds generated from the samples provided.

Instructions

Step by step instructions are provided with screenshots below.

Configure environment variables for GenICam/HALCON

Some environment variables needs to be set before you can begin to use Zivid with GenICam. There are two options:

On your PC, navigate to SystemAdvanced System SettingsEnvironmental Variables

System properties

Under System variables, select Path variable and click Edit… (Do not click New at this stage or you will overwrite the existing value of the Path system variable!) and then add the following value by clicking New:

Variable name

Path

Variable value

C:Program FilesZividbin

Environment variables highlighting edit

Note

Ensure to have the correct path for your Zivid installation.

Click OK to go back to the Environment variables window and then click New to include the following system variable:

Variable name:

GENICAM_GENTL64_PATH

Variable value

C:Program FilesZividbin

Environment variables highlighting new
Adding new system variable

Press the Win + R keys on your keyboard. Then, type cmd and press Enter.

Windows Run command

Type the following commands:

set PATH=%PATH%;C:\Program Files\Zivid\bin
set GENICAM_GENTL64_PATH=C:\Program Files\Zivid\bin
"%HALCONROOT%\bin\x64-win64\hdevelop.exe"

Note

Make sure to have the correct paths for your HALCON and Zivid installations

Setting variables in cmd

Now that your environment variables are set, you are ready to run samples. Select your language:

The video below shows you how to run samples using Zivid camera in HALCON.

Open HDevelop, and click on Open Program. Go to the location where you downloaded/cloned the samples.

Open the sample that you would like to run, e.g. CaptureHDR.hdev.

HALCON sample program script in HDevelop

Run the program by pressing the F5 key. The program should now run successfully and display the 3D point cloud of your scene.

Sample view of point cloud in HDevelop

To run the samples, follow this tutorial and select Halcon from the optional requirements:

You have two options to capture and save a point cloud, demonstrated with two samples:

To run the samples, follow this tutorial and select Halcon from the optional requirements:

You have two options to capture and save a point cloud, demonstrated with two samples: