Skip to content

Halcon Vision Installation and Usage

This tutorial explains how to connect drag&bot with a Halcon Vision system.

Preconditions and relevant information

Requirements

  • Halcon software must be installed on the same drag&bot PC or on a different PC in the same network of the drag&bot PC. The installation manual can be located on the Halcon website
  • A Linux Halcon installation is assumed in this tutorial.
  • Download the drag&bot Halcon driver from here: DOWNLOAD 💾.

Note

  • This driver was created and tested using Halcon HDevelop version 19.11 Progress.

Importing and starting the hdevelop driver

  1. Open the Halcon HDevelop by typing hdevelop in the Linux terminal
  2. From File Menu Select Open program.

    000

  3. Navigate to the drag&bot halcon driver location on your PC, select it and click Open.

    001

  4. Click on the Reset Program Execution icon. Then click on Run icon. The driver is ready now and waiting for the drag&bot Halcon d&b Component to be running.

    002

Halcon IP and Port number

The Halcon driver is pre-configured to work in the same PC that drag&bot is running. If you want to run it on a different PC please change the value of the IP variable to the IP address of the drag&bot's PC. This is applicable also for the port_number.

005

Starting Halcon component at drag&bot

  1. Click on Add component, Click on the + sign beside the Halcon Vision, then click on Update and install. Wait a bit till the component is loaded.

    006

  2. Click on the PEN icon to edit the driver configuration.

    007

  3. Enter the communication port number if changed at the Halcon software side and enter the desired auto image publisher frequency, then click Apply.

    008

  4. Once the Halcon component status is shown as Running you can start using the drga&bot Halcon programs.

    009

Note

  • Auto Image publisher frequency can't be guarenteed because it's depends on many factors such as the image size, current load on the PC CPU, network speed, etc.

Function Blocks

Halcon - Get Text Object Function Block

This function block triggers a program and retreives a text from the program (e.g. extracted from QR/bar code).

Name Datatype Description
Inputs Program ID Integer The program/procedure number to be triggered at the Halcon side
Timeout float Timeout in seconds in case of no response from Halcon side
Outputs success Boolean The execution success flag
error msg String The error message in case of an error
detected text String The detected text from the Halcon program

Halcon - Get Pose Function Block

This function block is using to trigger a program which returns a robot position. This can be used for example to detect a 2D or 3D coordinate. It includes also the transformation in case that the camera is extrinsically calibrated in drag&bot (only for 2D detection available).

Name Datatype Description
Inputs Program Type String Select whether to trigger a 2D or 3D coordinate program
Program ID Integer The program/procedure number to be triggered at the Halcon side
Timeout float Timeout in seconds in case of no response from Halcon side
Transformation String Use transformation in case that the Camera is extrinsically calibrated in drag&bot (only for 2D detection)
Calibration Name String The camera calibration file name in case of using transformation (only for 2D detection)
Outputs success Boolean The execution success flag
No. Of detected objects Integer Return the number of detected objects
Position POSE Return the position of the first detected object

Halcon - Trigger single frame image Function Block

This function block gets and publishes a single frame image.

Name Datatype Description
Outputs success Boolean The execution success flag

Halcon - Set Automatic Image Publisher Function Block

This function block can activate/deactivate the Halcon automatic image publisher.

Name Datatype Description
Inputs Activate String Activate/deactivate the Halcon automatic image publisher
Outputs success Boolean The execution success flag

Note

  • Auto Image publisher frequency depends on the selected frequency in the drag&bot Halcon component.
  • Auto Image publisher of big size picture or with higher frequency can affect the driver performance.
  • Auto Image publisher frequency can't be guaranteed and it will be depends on many factors such as the image size, current load on the PC CPU, network speed, etc.