interfaces mvtec

Interface Documentation

OPC_Classic I/O Interface for OPC Classic compliant devices

Interface: OPC_Classic
Revision: 1.4
Date: 2017-03-06
HALCON Version: 12.0
This product includes cryptographic software written by Eric Young (eay@cryptsoft.com).

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/).

General

This page provides the documentation of the HALCON OPC Classic interface. 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 Vista/7/8, Windows Vista/7/8 x64, also WoW64 (using 32-bit HALCON on 64-bit Windows).
  • OPC Core Components Redistributable package for Windows x86 or Windows x64. If this package is not installed, please download and install it from the OPC Foundation website.
  • Windows: HALCON I/O device interface hioOPC_Classic.dll or hioOPC_Classicxl.dll, respectively. Also required are libeay32.dll, ssleay32.dll, and uastack.dll. 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. Please note that the HALCON OPC_UA interface uses the same DLLs.

Installation

Only when installing or updating the interface manually follow these steps:
  • Windows: 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.
  • Linux: Extract the archive containing the interface files to the HALCON base directory $HALCONROOT.

Features

  • Implementation of an OPC Classic (also known as OPC DA, OPC ComDA) client.

Limitations

  • Only OPC Data Access (OPC DA) is supported.
  • No OPC device discovery. OPC Classic server name must be set according to the setup of the server.
  • No support for public groups.
  • The OPC Classic I/O interface returns and expects all strings in UTF-8 encoding.
  • All dates and times are assumed to be UTC.
  • The OPC Classic I/O interface only supports one-dimensional arrays, and it can only do so if a single OPC value is being read or written (i.e., if read_io_channel or write_io_channel are used with multiple channel handles, only scalar values are allowed in each channel).
  • On 32-bit systems, 64-bit OPC integer values (both signed and unsigned) cannot be properly represented. They can only be used if the actual value fits within a 32-bit integer.

Connecting to an OPC Classic server

The open_io_device operator is used to connect to an OPC Classic server. Specify the URL of the server to connect to with the IODeviceName parameter. The server URL is generally in the form 'opcda://<machine name>/<server ProgID>[/<CLSID>]'.

Converting data between HALCON and OPC Classic

OPC Classic has a rich set of data types that have to be mapped to the HALCON control tuple data types integer, real and string on input and output. The HALCON OPC Classic I/O device interface supports the following built-in OPC data types:
  • Boolean
    A boolean value, translated to and from the HALCON strings 'true' and 'false'.
  • SByte, Int16, Int32, and Int64
    These types are translated to and from HALCON integer values. On 32-bit systems, 64-bit integers outside the range of a 32-bit integer cannot be represented.
  • Byte, UInt16, UInt32, and UInt64
    These types are translated to and from HALCON signed integer values. An unsigned value outside the range of HALCON's signed integers is represented as the signed integer corresponding to the bit pattern of the unsigned integer. On 32-bit systems, 64-bit integers outside the range of a 32-bit integer cannot be represented.
  • DateTime
    The date is translated to and from the number of seconds since January 1, 1970 as a HALCON real value.
  • Double and Float
    These types are translated to and from HALCON real values.
  • String
    This type is represented as a HALCON string. Please note that the OPC Classic I/O interface returns and expects all strings in UTF-8 encoding.

Specifying OPC Classic variables

OPC Classic items are referenced by using their item ID written as a string as the channel parameter in the query_io_device and open_io_channel operators.

Operator get_io_device_param



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'.

Operator get_io_channel_param



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'.

Operator read_io_channel

Operator write_io_channel

OpenSSL

This software uses Unified Automation's OPC UA SDK to provide OPC functionality. This toolkit uses OpenSSL 1.0.2j. It was configured and built with the options no-idea, no-mdc2, no-ntt, and no-rc5 to avoid patent issues.

If bugs are found in the version of OpenSSL provided by MVTec and you do not want to wait for an update of the interface, you can compile and use your own version.

HDevelop Examples

For this interface the following examples are available:
  • opc_browse_variables.hdev - Shows how to browse the available items on an OPC Classic server.
  • opc_channel_access.hdev - Shows how to read and write OPC Classic items.
  • opc_parameters.hdev - Shows how to determine which parameters are supported.

Release Notes

  • Revision 1.4 (Mar 06, 2017):
    • Update OpenSSL to version 1.0.2j
    • Update to version 1.5.4 of the Unified Automation OPC UA SDK
  • Revision 1.3 (Oct 28, 2016):
    • Update OpenSSL to version 1.0.1u.
    • Update to version 1.5.2 of the Unified Automation OPC UA SDK.
  • Revision 1.2 (Feb 15, 2016):
    • Update OpenSSL to version 1.0.1r.
    • Update to version 1.5 of the Unified Automation OPC UA SDK.
    • Fix potential memory leak when dealing with byte strings.
  • Revision 1.1 (May 11, 2015):
    • Fixed interface crashing when passing incorrect number of values to write_io_channel.
    • Fixed problem with reading value arrays.
  • Revision 1.0 (Sep 22, 2014):
    • First official release.