Contec I/O Interface for Contec digital I/O devices
|
Interface:
|
Contec
|
|
Revision:
|
24.11.4
|
|
Date:
|
2026-09-23
|
General
This page provides the documentation of the HALCON Contec interface for accessing the
Contec Digital I/O cards.
Only interface specific parameters and features are
described here. For general information of the operators for I/O
interfaces please have a look at the HALCON Operator Reference.
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,
also WoW64 (using 32-bit HALCON on 64-bit Windows).
- Installed Contec Runtime with version 4.4. (or higher). The CDIO.dll must
be found within you search path.
- Windows: HALCON I/O interface hioContec.dll
or hioContecxl.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.
Installation
Only when installing or updating the interface manually follow these steps:
- Extract the archive containing the interface files to the
HALCON base directory %HALCONROOT% (Note: Administrator privileges may be
required for this step). Additionally, you have to move the interface
examples to the directory %HALCONEXAMPLES% manually.
Features
- Opening and using of multiple Contec I/O ports.
- Opening and using of multiple specific channels (specific port values).
- Support of digital inputs and digital outputs.
Limitations
- No support of counters.
- No support of analog functions.
- No support of bi-directional I/O channels.
Not supported by this interface.
query_io_interface(::IOInterfaceName, Query:Result)
Query information about the specified I/O device interface.
| Parameter |
Values |
Type |
Description |
| IOInterfaceName |
'Contec' |
string |
HALCON I/O interface name. |
| Query |
|
string |
Parameter name of the query. |
| 'io_device_names' |
|
string |
Returns a list of available devices. |
| 'param_name' |
|
string |
Returns the possible parameter names. |
| 'revision' |
|
string |
Revision number of the Contect interface. |
| Result |
|
integer, real, string |
List of result values (according to Query). |
open_io_device(::IOInterfaceName, IODeviceName, GenParamName, GenParamValue:IODeviceHandle)
Open and configure an I/O device.
| Parameter |
Values |
Default |
Type |
Description |
| IOInterfaceName |
'Contec' |
[] |
string |
HALCON I/O interface name. |
| IODeviceName |
|
[] |
string |
I/O device name. |
| GenParamName |
|
[] |
string |
Dynamic parameter names. |
| GenParamValue |
|
[] |
integer, real, string |
Dynamic parameter values. |
| IODeviceHandle |
|
|
handle |
Handle of the opened I/O device. |
Not supported by this interface.
Set the device parameters. Currently, no parameters are defined.
get_io_device_param(::IODeviceHandle, GenParamName:GenParamValue)
Query settings of an I/O device instance.
There may exist additional parameter attributes, which can be accessed as
'ParamNames.AttributeName'. The following standard attributes may
be available:
- '.access': This attribute provides the access permissions of
the corresponding parameter as a string. Possible values are
'ro' (read-only), 'wo' (write-only), 'rw'
(read/write), 'na' (unavailable, perhaps due to insufficient
access rights), and 'ni' (unavailable, not defined for this
device or channel).
- '.category': This attribute provides the category of the
corresponding parameter as a string. 'I/O interface' for all pre-defined
I/O interface parameters.
- '.default': This attribute provides the default value of the
corresponding parameter.
- '.description': This attribute provides the description of the
corresponding parameter as a string.
- '.displayname': This attribute provides the displayname of the
corresponding parameter as a string.
- '.range': This attribute provides the minimum and maximum,
(and the step width, if applicable) for the corresponding integer or
float parameter as a tuple with 2 (or 3) elements.
- '.representation': This attribute provides how the value of the
parameter should be displayed in a GUI: 'ip address', 'hex', ...
- '.tooltip': This attribute provides the tool-tip of the
corresponding parameter as a string.
- '.type': This attribute provides the HALCON value type (integer,
real, or string) of the corresponding parameter as a string.
- '.values': This attribute provides the valid value list for
the corresponding parameter as a tuple.
- '.visibility': This attribute provides the visibility of the
corresponding parameter as a string. Possible values are
'common', 'extended', and 'dangerous'.
- '.unit': This attribute provides the units of the corresponding
parameter as a string. For example: 'ns', 'us' and
'ms', or 'mm', 'cm', 'dm' and
'm'.
| Parameter |
Values |
Type |
Description |
| IODeviceHandle |
|
handle |
Handle of the opened I/O device. |
| GenParamName |
|
string |
Parameter names. |
| 'io_device_name' |
|
string |
Returns the name of the device. |
| 'param_name' |
|
string |
Returns the possible parameter names. |
| GenParamValue |
|
integer, real, string, handle |
Parameter values. |
query_io_device(::IODeviceHandle, IOChannelName, Query:Result)
Query information about channels of the specified I/O device.
| Parameter |
Values |
Type |
Description |
| IODeviceHandle |
|
handle |
Handle of the opened I/O device. |
| IOChannelName |
|
string |
Channel names to query. |
| Query |
|
string |
Name of the query. |
| 'channel_type' |
'digital_input', 'digital_output' |
string |
Returns the type of a channel. |
| 'io_channel_names' |
|
string |
Returns a list of channels provided by the device e.g. 'di_0.2' describes input port channel 2 on port 0. To list only the channels of a specific type, use the special form io_channel_names.<channel_type> (for a list of valid channel types, see the description of the channel_type parameter). |
| 'param_name' |
|
string |
Returns the possible parameter names. |
| 'value.range' |
[<min>,<max>,<step>] |
string |
Return the possible range of the used I/O channel name parameter |
| Result |
|
integer, real, string |
List of values (according to Query). |
open_io_channel(::IODeviceHandle, IOChannelName, GenParamName, GenParamValue:IOChannelHandle)
Open and configure I/O channels.
| Parameter |
Values |
Default |
Type |
Description |
| IODeviceHandle |
|
|
handle |
Handle of the opened I/O device. |
| IOChannelName |
|
|
string |
HALCON I/O channel names of the specified device. |
| GenParamName |
|
[] |
string |
Parameter names. |
| GenParamValue |
|
[] |
integer, real, string |
Parameter values. |
| IOChannelHandle |
|
|
handle |
Handles of the opened I/O channel. |
Not supported by this interface.
Not supported by this interface.
get_io_channel_param(::IOChannelHandle, GenParamName:GenParamValue)
Query specific parameters of I/O channels.
There may exist additional parameter attributes, which can be accessed as
'ParamNames.AttributeName'. The following standard attributes may
be available:
- '.access': This attribute provides the access permissions of
the corresponding parameter as a string. Possible values are
'ro' (read-only), 'wo' (write-only), 'rw'
(read/write), 'na' (unavailable, perhaps due to insufficient
access rights), and 'ni' (unavailable, not defined for this
device or channel).
- '.category': This attribute provides the category of the
corresponding parameter as a string. 'I/O interface' for all pre-defined
I/O interface parameters.
- '.default': This attribute provides the default value of the
corresponding parameter.
- '.description': This attribute provides the description of the
corresponding parameter as a string.
- '.displayname': This attribute provides the displayname of the
corresponding parameter as a string.
- '.range': This attribute provides the minimum and maximum,
(and the step width, if applicable) for the corresponding integer or
float parameter as a tuple with 2 (or 3) elements.
- '.representation': This attribute provides how the value of the
parameter should be displayed in a GUI: 'ip address', 'hex', ...
- '.tooltip': This attribute provides the tool-tip of the
corresponding parameter as a string.
- '.type': This attribute provides the HALCON value type (integer,
real, or string) of the corresponding parameter as a string.
- '.values': This attribute provides the valid value list for
the corresponding parameter as a tuple.
- '.visibility': This attribute provides the visibility of the
corresponding parameter as a string. Possible values are
'common', 'extended', and 'dangerous'.
- '.unit': This attribute provides the units of the corresponding
parameter as a string. For example: 'ns', 'us' and
'ms', or 'mm', 'cm', 'dm' and
'm'.
| Parameter |
Values |
Type |
Description |
| IOChannelHandle |
|
handle |
Handles of the opened I/O channels. |
| GenParamName |
|
string |
Parameter names. |
| 'io_channel_name' |
|
string |
Returns the name of the channel. |
| 'param_name' |
|
string |
Returns the possible parameter names. |
| GenParamValue |
|
integer, real, string, handle |
Parameter values. |
read_io_channel(::IOChannelHandle:Value, Status)
Read a value from the specified I/O channels.
| Parameter |
Values |
Type |
Description |
| IOChannelHandle |
|
handle |
Handles of the opened I/O channels. |
| Value |
|
integer, real, string, handle |
Read value. |
| Status |
|
integer |
Status of read value. A status of '0' indicates success, while any other value indicates an error condition.
|
write_io_channel(::IOChannelHandle, Value:Status)
Write a value to a specific io channel. If several handles are passed, the data of each handle will be written internally to the associated channel.
| Parameter |
Values |
Type |
Description |
| IOChannelHandle |
|
handle |
Handles of the opened I/O channels. |
| Value |
|
integer, real, string, handle |
Write values. |
| Status |
|
integer |
Status of written values. A status of '0' indicates success, while any other value indicates an error condition.
|
close_io_channel(::IOChannelHandle:)
Close I/O channels.
| Parameter |
Type |
Description |
| IOChannelHandle |
handle |
Handles of the opened I/O channels. |
close_io_device(::IODeviceHandle:)
Close the specified I/O device.
| Parameter |
Type |
Description |
| IODeviceHandle |
handle |
Handle of the opened I/O device. |
Query the requested information from the specified I/O channels. The parameter 'ParameterNode' is not used by this interface.
HDevelop Examples
For this interface the following examples are available:
- contec_digital_read.hdev -
Example to show how to read several parameters and values.
- contec_digital_write.hdev -
Example to show how to write serveral parameters and values.
Release Notes
- Revision 24.11.4 (Sep 23, 2026):
- Minor bug fixes.
- A Software Bill of Materials (SBOM) in the System Package Data Exchange
(SPDX) format has been added next to each binary file with the same name
extended by ".spdx.json".
- Revision 20.11.3 (Aug 1, 2023):
- Extended error messages are now available in case an operation failes.
This allows to get information about the root cause.
- The distribution package of this interface now contains files providing
meta information for the HDevelop example browser.
- Revision 13.0.2 (Nov 28, 2017):
- The technical dependency from the HALCON Library has been removed.
- Revision 13.0.1 (Oct 28, 2016):
- HALCON 13 version of the interface.
- Revision 1.1 Addendum (Sep 9, 2015):
- Bi-directional I/O channels are not supported. A note has been added
to the 'Limitations' section.
- The HDevelop examples contec_digital_read.hdev and
contec_digital_write.hdev have been improved.
- Revision 1.1 (Jan 1, 2015):
- Revision 1.0 (May 26, 2014):
Legal disclaimer regarding hyperlinks:
This page may provide users with access by hypertext links to external, non-MVTec websites.
Any such access is provided with the understanding that the contents
of non-MVTec sites are beyond the control of MVTec Software GmbH, that
MVTec Software GmbH makes no representations whatsoever about such
sites, and that users shall proceed at their own risk.
MVTec Software GmbH is not responsible for the privacy practices or
the content of external, non-MVTec websites.
Copyright notes:
© Copyright MVTec Software GmbH. All rights reserved.
Unless otherwise stated, the copyright and similar rights in the
contents of this page, including but not limited to all text, designs
and images appearing herein, are copyrighted works owned by MVTec
Software GmbH.
"MVTec Software GmbH" and "HALCON" are registered trademarks of MVTec
Software GmbH.
All other brand names, designs, service marks and trademarks (whether
or not registered) referenced or used herein are the property of their
respective owners.