MVTec Software GmbH
  Building Vision For Business
MVTec at AUTOMATICA 2012
Halcon

HALCON 10 Image Acquisition Interface for ADLINK CPL64 Boards

This page provides the documentation of the HALCON ADLINK interface for the ADLINK frame grabber board CPL64. Registered customers can download the latest revision of this interface from the MVTec WWW server.

Revision: 4.0

System Requirements

  • Intel compatible PC with Windows XP/Vista/7.
  • Successfully installed ADLINK drivers cpl64fg.sys and clseradl.sys (for CPL64).
    If you do not have these drivers, please contact ADLINK or the vendor from which you bought the frame grabber board.
  • ADLINK DLLs Cpl64.dll and clallserial.dll (for CPL64).
    These DLLs must be in your search path %PATH%. If you do not have these DLLs, please contact ADLINK or the vendor from which you bought the frame grabber board.
  • HALCON image acquisition interface hAcqADLINK.dll or hAcqADLINKxl.dll, respectively.
    If you have properly installed the interface, both DLLs should reside in bin\%HALCONARCH% within the HALCON base directory %HALCONROOT% you have chosen during the installation of HALCON.

Features

  • Multiple frame grabber boards.
  • Multiple compatible cameras per board.
  • Synchronous and asynchronous grabbing.
  • External trigger (with software override of the camera configuration file).
  • Support of multiple analog and digital cameras based on the ADLINK camera configuration files.
  • Support of line scan cameras.
  • (Partial) software control of the number of bits per pixel (with software override of the camera configuration file).
  • Support of the digital output lines.
  • Support of start/stop trigger mode.
  • Support of user-specific callback function.

Limitations

  • grab_data, grab_data_async, get_framegrabber_lut, and set_framegrabber_lut not supported.
  • No subsampling or cropping of image parts through the HALCON interface. This feature is supported through the use of camera files.
  • No support of dynamically changing the frame size of the grabbed image.

Description

Parameters for open_framegrabber():

Name 'ADLINK' The name of the HALCON image acquisition interface.
HorizontalResolution --- Ignored. The corresponding setting of the camera configuration file is used.
VerticalResolution --- Ignored. The corresponding setting of the camera configuration file is used.
ImageWidth 0 The width of the desired image part ('0' stands for the complete image). Default: 0.
ImageHeight 0 The height of the desired image part ('0' stands for the complete image). Default: 0.
StartRow 0 The row coordinate of the upper left pixel within the desired image part ('0' obviously results in delivering the complete image). Default: 0.
StartColumn 0 The column coordinate of the upper left pixel within the desired image part ('0' obviously results in delivering the complete image). Default: 0.
Field --- Ignored.
BitsPerChannel --- Ignored. The corresponding setting of the camera configuration file is used.
ColorSpace 'gray', 'rgb' The desired color space. Default: 'gray'.
Generic --- Ignored.
ExternalTrigger --- Ignored.
CameraType 'camfile' This parameter is used to specify the camera configuration file (e.g., 'Dalsa-HS-80-08K80(8bit)-area.ini').
Device '<DeviceName>:<nr>', 'default' The device name ('ADLINK CPL64') and the number ('0', '1', '2' ...) of the frame grabber board (passed as one string!), e.g., 'ADLINK CPL64:0'. Default: 'ADLINK CPL64:0'.
Port 0, 1, 2, 3 The port number (starting with 0 for the first camera). Default: 0.
LineIn --- Ignored.

Parameters for set_framegrabber_param():

For further details on supported parameters, please refer to the user's manual of the used ADLINK board.

'CameraConfiguration' 0, 1 (long) Sets the camera configuration. 0: base; 1: medium.
'CaptureMode' 0, 1, 2 (long) Sets the capture mode. 0: free run; 1: line area trigger; 2: encoder input.
'CC1NegativePulseWidth' width (long) Sets the negative part of width of pulse output of CC1.
'CC1Polarity' 0, 1 (long) Sets the polarity of CC1. 0: low; 1: high, or 0: normal; 1: inverse for pulse output.
'CC1PulseWidth' width (long) Sets the width of pulse output of CC1.
'CC1Type' 0, 1 (long) Sets the type of CC1. 0: pulse output, 1: digital output.
'CC2NegativePulseWidth' width (long) Sets the negative part of width of pulse output of CC2.
'CC2Polarity' 0, 1 (long) Sets the polarity of CC2. 0: low; 1: high, or 0: normal; 1: inverse for pulse output.
'CC2PulseWidth' width (long) Sets the width of pulse output of CC2.
'CC2Type' 0, 1 (long) Sets the type of CC2. 0: pulse output, 1: digital output.
'CC3Polarity' 0, 1 (long) Sets the polarity of CC3. 0: low; 1: high, or 0: normal; 1: inverse for pulse output.
'CC4Polarity' 0, 1 (long) Sets the polarity of CC4. 0: low; 1: high, or 0: hormal; 1: hnverse for pulse output.
'DataValidDelay' delay (long) Sets the delay of data valid in clocks.
'DI0Event' 0, 1 (long) Sets the digital input event for channel 0. 0: disable event; 1: enable event.
'DI1Event' 0, 1 (long) Sets the digital input event for channel 1. 0: disable event; 1: enable event.
'DI2Event' 0, 1 (long) Sets the digital input event for channel 2. 0: disable event; 1: enable event.
'DI3Event' 0, 1 (long) Sets the digital input event for channel 3. 0: disable event; 1: enable event.
'do_abort_grab' --- Cancel current grab.
'DO0' 0, 1 (long) Sets the state of digital output for channel 0. 0: low, 1: high.
'DO1' 0, 1 (long) Sets the state of digital output for channel 1. 0: low, 1: high.
'DO2' 0, 1 (long) Sets the state of digital output for channel 2. 0: low, 1: high.
'DO3' 0, 1 (long) Sets the state of digital output for channel 3. 0: low, 1: high.
'DVALEnable' 0, 1 (long) Sets the state of data valid. 0: disable; 1: enable.
'DVALPolarity' 0, 1 (long) Sets the polarity of DVAL. 0: rising edge; 1: falling edge.
'EncoderCompareCount' count (long) Sets the compare count of encoder input signal.
'EncoderDelayCount' delay (long) Sets the encoder delay count.
'EncoderInputDirection' 0, 1 (long) Sets the the direction of encoder input signal when encoder input mode is A/B phase or A/B/Z phase. 0: CW; 1: CCW.
'EncoderInputMode' 0, 1, 2 (long) Sets the encoder input mode. 0: A phase; 1: A/B phase; 2: A/B/Z phase.
'FVALPolarity' 0, 1 (long) Sets the polarity of FVAL. 0: rising edge; 1: falling edge.
'grab_timeout' msec (long) Specify the desired timeout (milliseconds passed as a long) for aborting a pending grab. If -1 is specified, the timeout is set to infinite. Default: 5000.
'LineAreaTriggerPolarity' 0, 1 (long) Sets the polarity of line trigger in. 0: rising edge; 1: falling edge.
'LineAreaTriggerStartEnable' 0, 1 (long) Sets whether line area trigger is referred to the state of the line trigger start input. 0: disable, 1: enable.
'LineAreaTriggerType' 0, 1 (long) Sets the type of line trigger in. 0: TTL; 1: RS422.
'LinePageExternalTriggerPolarity' 0, 1 (long) Sets the polarity of line page external trigger. 0: rising edge; 1: falling edge.
'LinePageExternalTriggerStartPolarity' 0, 1 (long) Sets the start polarity of line page external trigger. 0: rising edge; 1: falling edge.
'LinePageExternalTriggerType' 0, 1 (long) Sets the type of line page external trigger. 0: TTL; 1: RS422.
'LinePageInternalTriggerStartPolarity' 0, 1 (long) Sets the start polarity of line page internal trigger. 0: rising edge; 1: falling edge.
'LVALEnable' 0, 1 (long) Sets the state of line valid. 0: disable; 1: enable.
'LVALPolarity' 0, 1 (long) Sets the polarity of LVAL. 0: rising edge; 1: falling edge.
'PixelFormat' 0, 1 (long) Sets the pixel format. 0: unpacked; 1: packed.
'PixelSize' 8, 10, 12, 16 (long) Sets the number of bits of a pixel. Currently, the number cannot be set higher than the initial value of the camera configuration file.
'PowerState' 0, 1, 2 (long) Sets the state of cable power. 0: auto detect; 1: short ground; 2: short +12 V.
'ScanMode' 0, 1, 2 (long) Sets the scan mode. 0: linescan; 1: areascan.
'SensorHeight' height (long) Sets the sensor height. Currently, the number cannot be set higher than the initial value of the camera configuration file.
'SensorTap' tap (long) Sets the sensor tap.
'SensorTapPlacement' value (long) Sets the scan method and direction of sensor tap.
'SensorWidth' width (long) Sets the sensor width. Currently, the number cannot be set higher than the initial value of the camera configuration file.
'start_async_after_grab_async' 'enable', 'disable' (string) By default, at the end of grab_image_async a new request for an asynchronous grab command is automatically given to the camera. If the parameter 'start_async_after_grab_async' is set to 'disable' this new grab command is omitted. Default: 'enable'.
'SystemBufferCount' size (long) Sets the size of frame buffer queue.
'TriggerInPolarity' 0, 1 (long) Sets the polarity of trigger in. 0: rising edge; 1: falling edge.
'TriggerOutMode' 0, 1 (long) Sets the mode of trigger out. 0: external trigger; 1: software trigger.
'TriggerOutPolarity' 0, 1 (long) Sets the polarity of trigger out. 0: low active; 1: high active.
'TriggerOutPulseWidth' width (long) Sets the pulse width of trigger out.
'TriggerOutState' 0, 1 (long) Sets the state of trigger out. 0: disable, 1: enable.
'volatile' 'enable', 'disable' (string) Grayscale only. In the volatile mode the image acquisition 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'.
'XOffset' offset (long) Sets the X offset.
'YOffset' offset (long) Sets the Y offset.

Parameters for get_framegrabber_param():

Additional parameters supported by get_framegrabber_param only. Note that all parameters supported by set_framegrabber_param except the ones with prefix 'do_' can also be accessed by get_framegrabber_param. Note that all parameters of get_framegrabber_param return an empty tuple if they are not supported by the used camera.

Furthermore, corresponding to the parameters supported by set_framegrabber_param, there may exist additional read-only parameters with the following postfixes:
  • '_description': These parameters provide the tooltip of the corresponding parameter as a string.
  • '_range': These parameters provide the minimum, maximum, stepwidth, and default values for the corresponding integer or float parameter as a tuple with 4 elements, e.g., get_framegrabber_param(..,'exposure_range',..) will return the output tuple [min,max,step,default]. Optionally, this tuple can also contain additional valid string values like 'auto' or 'manual'.
  • '_values': These parameters provide the valid value list for the corresponding parameter as a tuple, e.g., get_framegrabber_param(..,'volatile_values',..) will return the output tuple ['enable','disable'].
All these postfixed parameter names are not returned when calling info_framegrabber(..,'parameters',..) and are used to enable the easy parameterization via a generic graphical user interface, particularly the HDevelop Image Acquisition Assistant.

For further details on supported parameters, please refer to the user's manual of the used ADLINK board.

'available_callback_types' [callback_type] (strings) Query all callback types which are supported by this interface.
'ChannelState' state (long) Returns the current channel state. 0: stopped; 1: running.
'DataBits' bits (long) Returns the total bits of a pixel.
'DeviceFirmwareVersion' firmware (string) Returns the device firmware version.
'DeviceModelName' model (string) Returns the device name.
'DeviceVersion' version (string) Returns the device hardware version.
'DI0' value (long) Returns the current digital input state of channel 0.
'DI1' value (long) Returns the current digital input state of channel 1.
'DI2' value (long) Returns the current digital input state of channel 2.
'DI3' value (long) Returns the current digital input state of channel 3.
'DroppedFrames' number (long) Returns the number of dropped frames since the beginning of capture.
'EncoderCounterValue' value (long) Returns the counter value of valid encoder trigger in signals.
'image_available' 0, 1 (long) Returns the status of the last asynchronous grab command. The value 1 means that the image is already acquired and thus can be fetched by grab_image_async without delay.
'LibraryVersion' version (string) Returns the device library version.
'LineAreaCounterValue' value (long) Returns the counter value of valid line trigger in signals.
'num_buffers' number (long) The number of buffers used for the image acquisition.
'revision' revision (long) The revision of the HALCON ADLINK interface.

Parameters for set_framegrabber_callback():

The following callback types are supported by this interface:

'transfer_end' Corresponds to the end of the image DMA.

 

Once the callback is registered, on every occurrence of the underlying event (e.g., the notification that the transfer has finished) the specified callback function will be called. If the callback function is set to NULL, the corresponding callback will be unregistered.

The signature of the callback function is Herror (__stdcall *HAcqCallback)(void *AcqHandle, void *Context, void *UserContext) and uses the following parameters:
AcqHandle Acquisition handle of the corresponding image acquisition instance.
Context Optional context data of the specific callback. In the ADLINK interface, this parameter is the pointer to the buffer of the acquired frame.
UserContext User context as set via set_framegrabber_callback.

Using user-callback functions

Note that the execution time of a user-specific callback function should always be as short as possible since during the execution of a callback function the handling of further internal callbacks might be blocked. This can be achieved by removing the actual processing from the user-specific callback function to a separate thread that is controlled via signals or events.

Release Notes

  • Revision 4.0 (Sep 8, 2010):
    • First official release.
    • HALCON 10 version of the interface (included in HALCON 10 DVD).


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