MVTec Software GmbH
  Building Vision For Business
Halcon

HALCON 6.1 Frame Grabber Interface for Leutron PicPort and PicProdigy Boards

This document provides information about the HALCON interface HFGPicPort.dll (or HFGPicPort.so, respectively) for the Leutron PicPort frame grabber boards. As the latest revision of this interface is part of the LV-SDS software from Leutron, registered customers can download it from the Support Area of the Leutron WWW server.

Revision: 3.0

System Requirements

  • Intel compatible PC with either Windows NT 4.0 (Service Pack 4), Windows 2000, Windows XP or Linux.
  • Leutron LV-SDS software package.
    Windows NT/2000/XP: The LVSDS_NT\bin directory must be within your search path %PATH% (typically, the LV-SDS software is installed to C:\LVSDS_NT). If you do not have the LV-SDS software, please contact Leutron or the vendor from which you bought the frame grabber board. Modify your path variable accordingly!
    Linux: Please follow carefully the instructions from Leutron for installing the LV-SDS software under Linux.
  • Successfully installed Leutron driver lvppx.sys (Windows) or xlvppx.o (Linux), respectively.
    Typically, this file reside in the directory C:\Winnt\system32\drivers (Windows) or /usr/lib/lv (Linux) after installation of the LV-SDS software. If you do not have this driver, please contact Leutron or the vendor from which you bought the frame grabber board.
  • HALCON frame grabber interface HFGPicPort.dll (or parHFGPicPort.dll, respectively) for Windows.
    After successful installation of the LV-SDS software, the HALCON PicPort interface is usually located in C:\LVSDS_NT\bin. If this directory is within your %PATH% you don't need to copy the files HFGPicPort.dll and parHFGPicPort.dll into the directory bin\i586-nt4 within the HALCON base directory %HALCONROOT% you have chosen during the installation of HALCON (see also the instructions in C:\LVSDS_NT\3rdParty\Halcon\readme.txt).
    Furthermore, we recommend to copy the current HTML documentation of this interface from C:\LVSDS_NT\3rdParty\Halcon\doc to the directory doc\html\manuals within the HALCON base directory %HALCONROOT%.
  • HALCON frame grabber interface HFGPicPort.so for Linux.
    After successful installation of the LV-SDS software, the HALCON PicPort interface is usually located in /usr/LeutronVision/3rdParty/halcon/lib. You have to copy the file HFGPicPort.so into the directory lib/i586-linux2.2 within the HALCON base directory $HALCONROOT you have chosen during the installation of HALCON.
    Furthermore, we recommend to copy the current HTML documentation of this interface from /usr/LeutronVision/3rdParty/halcon/doc to the directory doc/html/manuals within the HALCON base directory $HALCONROOT.
  • Attention using Windows: When opening the frame grabber, new micro code is compiled internally which is stored in the host CPU memory. If opening the board fails, make sure that RpsBuffer in the Windows registry (HKEY_LOCAL_MACHINE\SOFTWARE\Leutron Vision\PRVPH) is set to a value big enough to store this code (0x00000100 (=256)) or higher; contact Leutron for further information.

Features

  • Multiple cameras on multiple frame grabber boards.
  • Serial and parallel (simultaneously from several cameras) grabbing.
  • Synchronous and asynchronous grabbing.
  • Different grabbing modes: external trigger, asynchronous reset, flash, frame integration, frame integration with asynchronous reset.
  • Subsampling.
  • Software cropping of image parts.
  • Support of digital cameras with more than 8bpp.
  • Support of color encoded cameras (Bayer array).
  • Support of PicPort I/O boards (see corresponding section below).

If you are working with several cameras connected to several boards, you can access all cameras through a single handle. The connection of the cameras to the boards is specified in the device parameter in combination with the port parameter (see description below). In this case you get a multichannel image when grabbing an image; access the individual images by access_channel(). The images themselves are either grabbed in a sequence - one after the other - or in parallel (simultaneously) from all cameras at the same time (see parameter 'sequence_acquisition' below).

If you want to grab from each camera separately use open_framegrabber() once for each camera to get several handles.

Limitations

  • grab_region() and grab_region_async() not supported.
  • No LUTs.
  • Subsampling will not work for dual channel cameras and for parallel acquisition of two cameras on the same grabber.
  • The asynchronous reset mode is not supported by the PicPort Color board.

Description

Parameters for open_framegrabber():

Name 'PicPort', 'PicProdigy' The name of the HALCON frame grabber interface.
HorizontalResolution 1, 2, 4 The desired image resolution. Use '1' for full resolution, '2' for subsampling by factor 2, and '4' for subsampling by factor 4. Default: 1.
VerticalResolution 1, 2, 4 The desired image resolution. Use '1' for full resolution, '2' for subsampling by factor 2, and '4' for subsampling by factor 4. Default: 1.
ImageWidth 0, width The width of the desired image part ('0' stands for the maximum image width). Default: 0.
ImageHeight 0, height The height of the desired image part ('0' stands for the maximum image height). Default: 0.
StartRow 0, row The row coordinate of the upper left pixel of the desired image part. If ImageHeight is set to 0, then both the first AND last StartRow rows of the image matrix are discarded. Default: 0.
StartColumn 0, column The column coordinate of the upper left pixel of the desired image part. If ImageWidth is set to 0, then both the first AND last StartColumn columns of the image matrix are discarded. Default: 0.
Field --- Ignored.
BitsPerChannel 8, 9, ..., 16 Number of bits per channel: Gray scale (8 ... 16 bits) or color (8 bits). Values greater than 8 are only valid when using a PicPort Digital board together with a appropriate camera type. In this case the gray value range of the grabbed HALCON image objects will be adjusted (e.g., 0 ... 511 when using a 10bpp camera) if you specify the actual number of bits (corresponding to the specified camera type). Default: 8.
ColorSpace 'gray','rgb' The desired color space. Default: 'gray'.
Gain --- Ignored.
ExternalTrigger 'true', 'false' Activate/deactivate external triggering.
CameraType cameraname This parameter is used to specify the camera connected to the frame grabber board. To define a camera use the camera editor delivered with the Daisy software. Default: 'BW_RS170'.
Device device The device parameter is used to specify the board(s) used for grabbing. You have to specify the board name and the number(s) of the board(s) you want to use; one for each camera. The numbers have to be separated by a ':'.
For example, if you want to use 2 (physical) boards together with one camera connected to the first and two cameras connected to the second board, you would say 'Picport Stereo H4-D:1:2:2'. For each board number there must be a digit in the port parameter (see below). The order of the (physical) board depends on your machine and is the order in which the driver finds the boards on the PCI bus. Default: 'Picport Stereo H4-S:1'.
Port [1-8]+ Specifies the port(s) the camera(s) is/are connected to. If you use more than one camera or more than one (physical) board, you have to specify one digit for each camera; each digit has to be in the range 1-8.
For example, if you are using two (physical) boards together with 3 cameras - one connected to the second port of the first board, one to the first port of the second board and one to the third port of the second board - you would say 213 together with the combination GrabberName:1:2:2 in the device parameter. Default: 1.
LineIn --- Ignored.

Parameters for set_framegrabber_param():

'volatile' 'enable', 'disable' 8bpp gray scale only. In the volatile mode the two frame grabber interface buffers are used directly to store HALCON images. This is the fastest mode avoiding to copy raw images in memory. However, be aware that older images are overwritten again and again as a side-effect. Thus, you can only process one image while you grab another image. Older images are invalid! Default: 'disable'.
'grab_timeout' milliseconds The timeout value (> 0 in milliseconds) for the grabbing of images. Default: 5000.
'acquisition_mode' 'default', 'async_reset', 'flash', 'frame_integration', 'frame_integration_async_reset' The acquisition mode you want to use for grabbing (e.g. frame integration, asynchronous reset, ...). The value string may be extended by optional additional parameters with the syntax described on the pages for the individual modules (e.g. 'async_reset:AR_ShutterTime 1000:AR_FlashEnable 1'). For a detailed description see the handbook LV-SDS from Leutron, chapter Sequencer DRAL configuration.
Default: 'default' (no special module is used).
'sequence_acquisition' 'serial', 'parallel' The order or timing in which the images are grabbed from the different cameras connected to the boards. Serial means switching from one camera to the next, parallel means from all cameras simultaneously. Default: 'serial'.
'boards_synchronized' 'enable', 'disable' Enable or disable synchronization of several (physical) boards among each other. Attention: the boards have to be connected with a special cable to the master grabber (the first one found on the PCI bus). Default: 'disable'.
'start_async_after_grab_async' 'enable', 'disable' By default, at the end of grab_image_async() a new asynchronous grab command is automatically given to the frame grabber board. If the parameter 'start_async_after_grab_async' is set to 'disable' this new grab command is omitted. This might be useful especially for random switching between several connected cameras. Default: 'enable'.
'suppress_timeout_beep' 'enable', 'disable' When set to 'disable', a beep is produced every time a timeout occurs during a pending grabbing command. Default: 'disable'.
'image_width' 0, width The width of the desired image part ('0' stands for the maximum image width). This value has to be equal or smaller than the maximum image width.
'image_height' 0, height The height of the desired image part ('0' stands for the maximum image height). This value has to be equal or smaller than the maximum image height.
'start_row' 0, row The row coordinate of the upper left pixel of the desired image part. If ImageHeight is set to 0, then both the first AND last StartRow rows of the image matrix are discarded.
'start_column' 0, column The column coordinate of the upper left pixel of the desired image part. If ImageWidth is set to 0, then both the first AND last StartColumn columns of the image matrix are discarded.
'optocoupler', 'buffered_optocoupler' 0 ... 255 Sets the current state of the output optocouplers (PentiCam and PicPort I/O only!). The value is a bitmask where each bit represents a single optocoupler. Each bit set to 1 means that the corresponding optocoupler output is set as active. The optocoupler associated with bit 0 cannot be set through this function because it is internally used by the PicPort interface.
'equalize_color_image' 'default', 'top:left:bottom:right' Performs an image color balancing before decoding the next Bayer array image (in combination with color encoded cameras only!). This adjustment is only applied once! As parameter value can be specified either 'default' (full image is processed) or a specific rectangle as 'top:left:bottom:right', i.e. '0:0:100:100'.
'external_trigger' 'true', 'false' Activate/deactivate external triggering.
'upperlevel' 0 ... 255 Define the upper level of the on-board ADCs (PicPort Monochrome only!).
'lowerlevel' 0 ... 255 Define the lower level of the on-board ADCs (PicPort Monochrome only!).
'brightness' -128 ... +127 The brightness can be adjusted in 256 steps from -128 to +127, corresponding to -50% to +50% of the full luma range (PicPort Color only!).
'contrast' 0 ... 511 The contrast can be adjusted in 512 steps from 0 to 511, corresponding to 0% to 236% of the original signal (PicPort Color only!).
'hue' -128 ... 127 The hue can be adjusted in 512 steps from -128 to 127 (PicPort Color only!).
'saturation' 0 ... 511 The saturation can be adjusted in 512 steps from 0 to 511 (PicPort Color only!).
'opto_config' 'num:value ...' Each opto input (num=0..31) can be configured with one of the following values (either using the digit or the string):
'0' or 'Disable': Never reported
'1' or 'RaisingEdge': Reported when transacting from low to high
'2' or 'FallingEdge': Reported transacting from high to low
'3' or 'BothEdge': Reported on any transaction
More opto inputs can be configured at the same time, each with its own settings. Furthermore, you can also configure all opto inputs with the same polarity using the 'All' string. Examples:
set_framegrabber_param(FGHandle,'opto_config','1:RaisingEdge')
set_framegrabber_param(FGHandle,'opto_config','1:2 2:0 3:0')
set_framegrabber_param(FGHandle,'opto_config','All:BothEdge')

Parameters for get_framegrabber_param():

Additional parameters supported by get_framegrabber_param() only. Note that all parameters supported by set_framegrabber_param() can also be accessed by get_framegrabber_param().

'revision' revision Revision of the HALCON frame grabber interface HFGPicPort.dll.
'optocoupler' 0 ... 255 Retrieves the current state of the input optocouplers at the time of the function call (PentiCam and PicPort I/O only!). The value is a bitmask where each bit represents a single optocoupler. Each bit retrieved as 1 means that the corresponding optocoupler input is active.
'buffered_optocoupler' 0 ... 255 Retrieves the current state of the input optocouplers that became active since the last use of the same function call (PentiCam and PicPort I/O only!). The value is a bitmask where each bit represents a single optocoupler. Each bit retrieved as 1 means that the corresponding optocoupler input is active.

Using the PicPort I/O Board

The PicPort I/O board is basically treated like the rest of the PicPort boards, but with the following particularities:

  • open_framegrabber(): Only the two parameters Name ('PicPort') and Device (e.g. 'Picport I/O:1') are evaluated.
  • set/get_framegrabber_param(): Only the parameters 'optocoupler', 'buffered_optocoupler', and 'revision' are allowed.
  • Obviously, the operators grab_image(), grab_image_async() etc. can not be applied in combination with a PicPort I/O board.

Release Notes

  • Revision 3.0 (Dec 6, 2002):
    • Unified version numbers.
    • Support for PicProdigy boards.
    • New parameter argument 'Flags' for 'acquisition_mode'.
    • New PicPort AR parameter 'FlashMode'.
  • Revision 2.10 (Aug 1, 2002):
    • Improvements in signal handling while waiting for the next image to avoid timing inconsistencies.
    • Additional parameters 'hue' and 'saturation'.
    • Added more debug maros for Linux.
  • Revision 2.7 (Sep 15, 2001):
    • Connection indices for PicPort Color fixed according to new parameter values for SetCameraSelection.
    • Adjusted for new sort order for connectors (PicPort Color).
  • Revision 2.6 (Aug 17, 2001):
    • Forcing an acquisition when the grabber goes in timeout waiting for an external event.
    • Additional parameter 'opto_config'.
  • Revision 2.4 (Jun 6, 2001):
    • Added support for the PicPort I/O board.
    • Bugfix in signal handling when waiting for a grab (Linux only).
  • Revision 2.3:
    • Added generic shutter type definitions for asyncronous reset, reflecting the new organization in the Camera Editor: The parameter 'ShutterType' can be either specific to the camera as used until now, or Mode_0 ... Mode_7 as defined in the Camera Editor.
  • Revision 2.2:
    • Additional parameters 'UpperLevel', 'LowerLevel', 'Brightness', and 'Contrast' (these parameters can now be set without entering a special acquisition mode via set_framegrabber_param('acquisition_mode')).
  • Revision 2.1 (Mar 13, 2001):
    • Adjustment of the gray value range when grabbing gray scale images with more than 8bpp.
    • Query all supported camera types via info_framegrabber('camera_types').
    • Query board information via info_framegrabber('info_boards').
  • Revision 2.0 (Sep 20, 2000):
    • Adaptation to the HALCON 6.0 frame grabber interface.
    • Color mode setting via BitsPerChannel and ColorSpace parameters in open_framegrabber().
  • Revision 1.14 (Aug 23, 2000)
    • Support of digital cameras with more than 8bpp.
    • Additional parameters 'optocoupler' and 'buffered_optocoupler'.
    • Additional parameter 'equalize_color_image'.
    • Activate/deactivate external triggering via set_framegrabber_param().
  • Revision 1.12 (Apr 13, 2000)
    • Software image cropping (i.e., evaluation of ImageWidth, ImageHeight, StartRow, and StartColumn during open_framegrabber()).
    • Additional parameters 'width', 'height', 'start_row', and 'start_column' for dynamically adaptation of the desired image part.
  • Revision 1.11 (Mar 31, 2000)
    • New parameters 'suppress_timeout_beep' and 'start_async_after_grab_async'.
    • get_framegrabber_param('revision') now also returns the used Daisy build number.
    • Some minor bugfixes (missing error returns, Picport Color random switching, etc.).
  • Revision 1.10 (Feb 25, 2000)
    • First release for running under the Linux operating system.
    • Additional parameters ':UpperLevel', ':LowerLevel', ':Brightness', ':Contrast' in the different grabbing modes.
  • Revision 1.6 (Sep 20, 1999)
  • Revision 1.2 (Mar 25, 1999)
    • First official release (included in the HALCON 5.2 CD).

© Copyright 2012, MVTec Software GmbH, corporate/legal/privacy information