Application Notes

How to acquire images in HALCON with an IDS GigE Vision camera

This application note shows how to acquire images with an IDS GigE Vision camera and the HALCON machine vision software. Because the HALCON installation brings its own GigE Vision compliant transport layer, it is not necessary using additional manufacturer specific software. Nevertheless, there are some advantages using the IDS Vision Suite with IDS GigE Vision cameras which the application note will mention.

Install HALCON development environment

Ensure that the HALCON machine vision development environment is installed completely on your system. You can download the newest release versions here: http://www.mvtec.com/login/?referer=download%2Fhalcon%2F

Consider that this software is not for free. Therefore, at least a valid evaluation license is required to run the software. To get such a license, please contact the IDS Support or MVTec.

Camera connection via HDevelop image acquisition assistantConfigurator

Figure 1: Open the HALCON image acquisition assistant
Figure 1: Open the HALCON image
acquisition assistant

Start HDevelop and use the image acquisition assistant to open a connected IDS GigE Vision camera.

Figure 2: Choose the acquisition interface
Figure 2: Choose the acquisition
interface

In the ‘Source’ tab HALCON gives you the choice to connect cameras with different interfaces. When pressing ‘Auto-detect Interfaces’ (see Figure 2, No. 1) HALCON probes and lists only those interfaces in the dropdown list that correspond to your connected camera.

The HALCON installation includes an own GigE Vision interface library. (see Figure 2, No. 2) Using this HALCON GenTL (GenICam Tranport Layer), it’s not necessary to install any specific camera manufacturer software.

Camera IP configuration

Figure 3: HDevelop suggest to force a valid IP configuration
Figure 3: HDevelop suggest to force a
valid IP configuration

If your camera has no valid or compatible IP configuration to connect the camera, HDevelop suggests to force an IP address with the according standard GenTL command ‘ForceIP’ to be able to use the camera for further operations.

Note, that forcing a cameras IP address is only volatile and not a static IP configuration. You are able to give the camera a valid IP configuration after connecting the camera with according GenAPI Parameter ‘GevPersistentIPAddress’ with HALCON operator ‘set_framegrabber_param’.

A detailed documentation of the HALCON Image Acquisition Interface for GigE Vision compliant cameras can be found under the following link: http://www.mvtec.com/products/halcon/interfaces/documentation/view/1302-standard-13-mvtecdoc-gigevision/

Open the IDS GigE Vision camera

Figure 4: Connection assistant to choose a camera device
Figure 4: Connection assistant to choose
a camera device

With the ‘Connection’ tab you can choose a connected IDS camera. The device is represented with an ID which is composed of cameras MAC address and its device name (see Figure 4, No.2).

The device may be reported as misconfigured. In this case, the device icon will show this symbol:

If you select such a device, the assistant may suggest a generic parameter that potentially resolves the misconfiguration. (for example by using the ‘GtlForceIP’ parameter).

With pressing ‘Connect’, the camera will be opened. Then you are able to set additional camera parameter in the ‘Parameters’ tab or see a ‘Live’ preview of the camera.

Generate HALCON script to acquire images

Figure 5: Generate HALCON code for acquiring images
Figure 5: Generate HALCON code for
acquiring images

With the ‘Code Generation’ tab you can generate HALCON script code for using the camera with chosen parameters in HDevelop for your machine vision project.

Generated HALCON code can look like this:

Figure 6: Generated camera acquisition code
Figure 6: Generated camera acquisition code

Tip

Figure 7: HALCON has also a GenICam<br>interface for external transport layers
Figure 7: HALCON has also a GenICam
interface for external transport layers

Another way setting a static IP configuration for IDS cameras is to use the tools included in the IDS Vision Suite, which provides you a complete software support to put your vision camera in operation quickly and easily. The IDS Vision Suite can be downloaded for free: https://en.ids-imaging.com/download-vision-win64.html

When the camera device has a preconfigured IP configuration HALCON doesn’t show a misconfigured camera and you do not have to force a valid IP address each time opening the camera.

With the IDS Vision Suite also the IDS GenTL will be installed. To use the camera with this additional transport layer you can choose the HALCON ‘GenICamTL’ interface (see Figure 7, No. 1).

By using the IDS GenTL you have an optimized image data transfer and the full IDS camera and software support with your application.