interfaces mvtec

Interface Documentation

Image Acquisition Interface for Leuze LPS 36 Sensors

Interface: LPS36
Revision: 13.0.1
Date: 2016-10-28
HALCON Version: 13.0

General

This page provides the documentation of the HALCON image acquisition interface for Leuze LPS 36 light-section sensors. Registered customers can download the latest revision of this interface from the MVTec WWW server.

System Requirements

  • Intel compatible PC with Windows 7 (32-bit or 64-bit) or newer that is also supported by the vendor-specific SDK, or Linux with kernel 2.4 (or higher).
  • Network interface card.
  • Windows: HALCON image acquisition interface hAcqLPS36.dll or hAcqLPS36xl.dll, respectively. If you have properly installed the interface, all these DLLs should reside in bin\%HALCONARCH% within the HALCON base directory %HALCONROOT% you have chosen during the installation of HALCON.
    Linux: HALCON image acquisition interface hAcqLPS36.so or hAcqLPS36xl.so, respectively. If you have properly installed the interface, the shared objects should reside in lib\$HALCONARCH within the HALCON base directory $HALCONROOT you have chosen during the installation of HALCON.

Features

  • Grabbing of equidistant images using grab_image. These images are computed from the raw data and take the encoder values into account if available. The raw data is converted to a image with a width of 600 pixels. The height of the image corresponds to the number of scan lines when there is no encoder data or is variable depending on the minimum and maximum values of the encoder data. If the resulting height would exceed the maximum image height the encoder data is scaled automatically. The gray value of a pixel corresponds to the distance (z-axis). The image is scaled in a way that one pixel in the width or one gray-value correspond to 1mm in the real world. The height is currently not scaled.
  • Access to x and z distance data via image tuples using grab_data. grab_data also enables direct access to encoder values when an external encoder is available.
  • Software control of important sensor parameters.

Limitations

  • No scaling of height values.
  • No triggering.
  • No support for cascading sensors.
  • No support of asynchronous grabbing.

Parameters for info_framegrabber

Parameter Value List Type Kind Description
'bits_per_channel' [-1, 8, 10, 12, 14, 16] integer pre-defined Values for bits per channel.
'camera_type' [] Unused.
'color_space' ['raw', 'gray'] string pre-defined Values for color space.
'defaults' [376, 128, 0, 0, 0, 0, 'default', 16, 'raw', -1.0, 'false', 'default', 'default', -1, 0] mixed pre-defined Default values for open_framegrabber.
'device' ['<ip_address>'] string pre-defined IP address or network name of the camera.
'external_trigger' [] Unused.
'field' [] Unused.
'general' [] string pre-defined Information about the HALCON LPS36 interface.
'generic' ['', 'device_port=<num>', 'pc_port=<num>'] string pre-defined Value list for the Generic parameter.
'horizontal_resolution' 1 integer pre-defined Value list for horizontal resolution.
'image_height' [] Unsupported query.
'image_width' [] Unsupported query.
'info_boards' [] Query of available devices not possible, so an empty tuple is returned.
'parameters' ['<parameters>'] string pre-defined Pre-defined parameters of the HALCON interface.
'parameters_readonly' ['<parameters>'] string pre-defined Pre-defined read-only parameters of the HALCON interface.
'parameters_writeonly' ['<parameters>'] string pre-defined Pre-defined write-only parameters of the HALCON interface.
'port' [] Unused.
'revision' '<revision>' string pre-defined Revision number of the LPS36 interface.
'start_column' [] Unsupported query.
'start_row' [] Unsupported query.
'vertical_resolution' 1 integer pre-defined Value list for vertical resolution.

Parameters for open_framegrabber

Parameter Values Default Type Description
Name 'LPS36' string Name of the HALCON interface.
HorizontalResolution 376, 1 376 integer Fixed horizontal resolution. 1 means full resolution.
VerticalResolution 1...32768 (or higher with HALCON XL) 128 integer Number of scan lines which are combined to an image. One line takes approximately 10ms to be acquired.
ImageWidth 0 0 integer The setting of the current horizontal resolution is used.
ImageHeight 0 0 integer The setting of the current vertical resolution is used.
StartRow --- Ignored.
StartColumn --- Ignored.
Field --- Ignored.
BitsPerChannel 16 16 integer The LPS 36 sensor supports 16 bits/pixel only.
ColorSpace 'raw', 'gray' 'raw' string The LPS 36 sensor always acquires raw images. These images contain raw x, z and possibly y (encoder) data and need post-processing. The x and z data unit is 1/10mm.
Generic '', ['device_port=<num>', 'pc_port=<num>'], -1 -1 mixed With the Generic parameter some important values can be set before the camera is initialized.
  • device_port: Network port which is used by the device. This must be the same as set on the sensor via the menu. Default: 9008.
  • pc_port: Network port which is used by the PC. This must be the same as set on the sensor via the menu. Default: 5634.
ExternalTrigger --- Ignored.
CameraType --- Ignored.
Device <ip_address>, <host_name>, 'default' '192.168.60.3' string IP address or network name of the camera.
Port --- Ignored.
LineIn --- Ignored.

Parameters for set_framegrabber_param

Note that most of the following parameters (and also the valid parameter values) depend on the capabilities of the used camera. Furthermore, the default values may depend on the current camera settings.
Parameter Values Default Type Description
'grab_timeout' <milliseconds> 5000 integer Specify the desired timeout (milliseconds passed as an integer) for aborting a pending grab. The value -1 sets the timeout to 65535. Note that one line takes about 10ms to be acquired, so for e.g. 100 lines the minimum usable timeout value is about 1000.
'inspection_task' 0 ... 15 integer Use the settings of the specified inspection task. You need to use the original LPSsoft tool from Leuze to specify and save such tasks.
'laser_gate' 'off', 'on' 'on' string Deactivates or activates the laser gate.

Parameters for get_framegrabber_param

There may exist additional read-only parameters with the following postfixes:
  • '_description': These parameters provide the tool-tip of the corresponding parameter as a string.
  • '_range': These parameters provide the minimum, maximum, step width, and default values for the corresponding integer or float parameter as a tuple with 4 elements, e.g., get_framegrabber_param(.., 'Shutter_range', ..) will return the output tuple [min, max, step, default].
  • '_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.

Parameter Values Default Type Kind Description
'bits_per_channel' 16 16 integer pre-defined Number of bits per channel of the resulting HALCON image. In case of -1 the current bit depth of the camera is used. By specifying a value greater than 8 the grabbed images are delivered as uint2 images.
'camera_type' '<default>' 'default' string pre-defined The value is not used, so a default value is returned.
'color_space' 'raw', 'gray' 'raw' string pre-defined Desired color space and thus the number of image channels of the resulting HALCON image.
'device' <ip_address>, <host_name> 'default' string dynamic IP address or network name of the camera.
'device_port' <port> 9008 integer dynamic Port which is used by the sensor/device.
'external_trigger' '<default>' 'false' string pre-defined The value is not used, so a default value is returned.
'field' '<default>' 'default' string pre-defined The value is not used, so a default value is returned.
'generic' '', ['device_port=<num>', 'pc_port=<num>'], -1 -1 mixed pre-defined Values of the Generic parameter.
'grab_timeout' <milliseconds> 5000 integer pre-defined Current grab timeout in milliseconds.
'horizontal_resolution' <resolution> 376 integer pre-defined Current value of horizontal resolution.
'image_height' <height> 0 integer pre-defined Height of the desired image part ('0' stands for the complete image).
'image_width' <width> 0 integer pre-defined Width of the desired image part ('0' stands for the complete image).
'inspection_task' 0 ... 15 integer pre-defined Use the settings of the specified inspection task. You need to use the original LPSsoft tool from Leuze to specify and save such tasks.
'laser_gate' 'off', 'on' 'on' string pre-defined Deactivates or activates the laser gate.
'line_in' <default> 0 integer pre-defined The value is not used, so a default value is returned.
'name' 'LPS36' string pre-defined Name of the HALCON interface.
'num_buffers' <num> integer dynamic Number of buffers currently used for grabbing images.
'pc_port' <port> 5634 integer dynamic Port which is used by the PC to communicate with the device.
'port' <default> -1 integer pre-defined The value is not used, so a default value is returned.
'revision' '<revision>' string pre-defined Revision number of the LPS36 interface.
'start_column' <column> 0 integer pre-defined The value is not used, so a default value is returned.
'start_row' <row> 0 integer pre-defined The value is not used, so a default value is returned.
'vertical_resolution' <resolution> 128 integer pre-defined Current value of vertical resolution.

Operator set_framegrabber_lut

Not supported by this interface.

Operator get_framegrabber_lut

Not supported by this interface.

Operator set_framegrabber_callback

Not supported by this interface.

Operator get_framegrabber_callback

Not supported by this interface.

Operator grab_image_start

Starts a new asynchronous grab. See also grab_image_start.

Operator grab_image

grab_image starts a new synchronous grab. See also grab_image. Note that the interface converts the image from the device to the desired image format specified by the parameters 'image_width', 'image_height', 'start_row', 'start_column', 'bits_per_channel', and 'color_space'.

Operator grab_image_async

Not supported by this interface.

Operator grab_data

The LPS36 interface allows the grabbing of additional data like x and z images. grab_data returns an array of images instead of a multi-channel image like grab_image or grab_image_async.
Parameter Type Count Description
'image' uint2 1...2 Depending on the used configuration an array of images is returned. x and z distance data can be returned.
'contours' Not used.
'region' Not used.
'data' tuple If an external encoder is enabled, the encoder values are returned.

Operator grab_data_async

Not supported by this interface.

Operator close_framegrabber

This operator closes the device. See also close_framegrabber.

HDevelop Examples

For this interface there are the following examples available:
  • lps36_objectmodel3d.hdev - Acquisition and visualization of calibrated 3D data.
  • lps36_parameters.hdev - Lists all parameters of a device.
  • lps36_simple.hdev - A simple example to show the usage of the interface.

Release Notes

  • Revision 13.0.1 (Oct 28, 2016):
    • HALCON 13 version of the interface.
  • Revision 6.1 (Feb 15, 2016):
    • If the parameter 'HorizontalResolution' in open_framegrabber was set to the maximum value a segmentation fault occurred. This problem has been fixed.
    • If the parameters 'StartRow' and/or 'StartColumn' were used in open_framegrabber, the error 6001 ("Not enough memory available") occurred. This problem has been fixed.
    • set_framegrabber_param crashed when called with an empty tuple. This problem has been fixed.
    • close_framegrabber crashed when an already opened device accidentally was opened a second time. This problem has been fixed.
  • Revision 6.0 (Oct 31, 2014):
    • HALCON 12 version of the interface.
  • Revision 5.1 (Jun 13, 2013):
    • Fixed 'generic' parameter values.
  • Revision 5.0 Addendum (Oct 18, 2012):
    • Added new example lps36_objectmodel3d.hdev that shows how to acquire and visualize calibrated 3D data.
  • Revision 5.0 (May 15, 2012):
    • HALCON 11 version of the interface (included in HALCON 11 DVD).
  • Revision 4.1 (Mar 21, 2012):
    • Improved usage in highly loaded networks: While waiting for a specific acknowledge make sure to wait up to 1s and ignore all other incoming packets.
    • Changed default IP address to match factory default of sensor.
    • Corrected swapped comments for x and z data in lps36_simple example.
  • Revision 4.0 (Aug 24, 2010):
    • First official release.
    • HALCON 10 version of the interface (included in HALCON 10 DVD).