| Interface: | OPC_UA |
| Revision: | 24.11.10 |
| Date: | 2026-04-09 |
If the server you wish to connect to is registered with an OPC UA discovery server, you can get its URL from the query_io_interface operator using the 'io_device_names' generic parameter if the discovery server is reachable via the URL 'opc.tcp://localhost:4840', or from the control_io_interface operator using the 'discovery' action if it is not. Please see the example opc_ua_discovery.hdev for details. The following security policies are supported:
'ns=<namespaceindex>;<type>=<identifier>'
<namespaceindex> is the index of the namespace,
formatted as a base 10 number. If the index is 0, the entire
'ns=0;' clause can be omitted. A server's namespaces can
be determined by calling the get_io_device_param operator for the
'namespaces' parameter; the namespaces are returned in
the order of their indexes.
<type> is a flag specifying the type of <identifier>. The following values are possible:
<identifier> is the identifier encoded as a string
using the XML data type mapping for the identifier type. The identifier
may contain any non-NULL UTF-8 character.
Please note that due to a limitation in the OPC UA SDK used by the
interface, when converting from a node ID to a HALCON string if the node
ID does not fit within 255 characters, it is truncated and cannot be used
to identify nodes.
'<Server>|<NamespaceURI>|<NodeId>'
<Server> is the index of the server, formatted as a base 10 number.
<NamespaceURI> is the URI of the namespace to use, overriding the namespace specified in the <NodeId>. The reserved characters & and | have to be escaped with a prefixed &, e.g. | must be written as &|.
<NodeId> is a node ID written in the OPC UA XML schema as detailed above.
'[<ns>:]<name>'
<ns> is the (optional) namespace index, written as one
or more digits and followed by a :. If the namespace is
not specified, a namespace of 0 is assumed.
<name> is the name. The reserved characters /, ., <, >, #, !, or & have to be escaped with a prefixed &, e.g. < must be written as &<.
'<locale>|<text>'
<locale> is the locale ID as defined in RFC 3066, e.g.
'en' for English.
<text> is the text, encoded in the specified
locale.
The following are all valid ways to refer to the server's ServerStatus node:
'i=2256'
'ns=0;i=2256'
'ns=^http://opcfoundation.org/UA/^;i=2256'
control_io_interface(::IOInterfaceName, Action, Argument:Result)
| Parameter | Values | Default | Type | Description |
|---|---|---|---|---|
| IOInterfaceName | 'OPC_UA' | [] | string | HALCON I/O interface name. |
| Action | string | Name of the action to perform. | ||
| 'create_certificate' | Create a self-signed X509 certificate and store it in the file-based OpenSSL certificate store. This action takes 13 arguments. | |||
| Argument | '<path to certificate store>', '<basename of certificate>', <keylength>, '<URI>', '<DNS>', <valid time (in seconds)>, '<common name>', '<organization>', '<organization unit>', '<locality>', '<state>', '<country>', '<domain component>' | integer, float, string | The first argument is the path to the certificate store (either be relative to the working directory or an absolute path), followed by the base name to store the certificate under (without the file extension). The third argument is the keylength to use (in bits). The fourth and fifth parameters are a URI and a DNS name, respectively, used to set the "X509v9 Subject Alternative Name". The fifth parameter is the valid time of the certificate in seconds. The final seven arguments are the common name, organization, organization unit, locality, state, country and domain component to use for the issuer and subject of the certificate. |
|
| Result | '<X.509 certificate in DER format, Base64 encoded>' | string | The X.509 certificate in DER format, encoded as a Base64 string. | |
| 'discovery' | Query an OPC UA discovery server to find OPC UA servers. The URL of the server to query must be passed as the only argument. | |||
| Argument | '<discovery server URL>' | string | The URL of the discovery server to query. | |
| Result | 'application_type:<application type>|application_uri:<application URI>|product_uri:<product URI>|application_name:<application name>|gateway_server:<gateway server IP address>|discovery_profile_uri:<uri>|url:<server url>[url:<server url>]' | string | A list of OPC UA servers. | |
| 'endpoints' | If used as a parameter to get_io_device_param, returns all endpoints of the server the device is connected to. It cannot be combined with any other queries. If used as an action for control_io_interface, returns all endpoints of the server reachable via the URL given as the only argument. |
|||
| Argument | '<server URL>' | string | The URL of OPC UA server to query. | |
| Result | 'endpoint_url:<server url>[|server_certificate:<certificate>]|message_security_mode:<mode>|security_policy_uri:<policy>|transport_profile_uri:<profile>|security_level:<level>' | string | A list of OPC UA endpoints. | |
| 'parse_certificate' | Take OpenSSL certificates in DER form and translate them into a human readable string presentation. | |||
| Argument | '<X.509 certificate in DER format, Base64 encoded>' | string | X.509 certificate(s) in DER format, encoded as a Base64 string(s). | |
| Result | 'CommonName:<common name>|Issuer.commonName:<common name of issuer>|Issuer.organization:<organization of issuer>|Issuer.organizationUnit:<organization unit of issuer>|Issuer.state:<state of issuer>|Issuer.country:<country of issuer>|ValidFrom:<valid from date>|ValidTo:<valid to date>' | string | ||
| 'save_certificate' | Save an OpenSSL certificate in the file-based OpenSSL certificate store. | |||
| Argument | '<Path to the certificate store>', '<Basename of certificate>', '<X.509 certificate in DER format, Base64 encoded>' | string | The first argument is the path to the certificate store, followed by the base name of the certificate (i.e., without the file extension). The final argument is the certificate in DER form, passed as a Base64 encoded string. | |
| Result | none | |||
| 'status_code_to_string' | Return the string representation of a OPC UA status code. | |||
| Result | string | |||
| 'strerror' | Convert OPC UA status codes into human readable strings. | |||
| Argument | <error code> | integer | ||
| Result | '<error string>' | string | ||
| 'thumbprint_certificate' | Returns the SHA1 thumbprints of OpenSSL certificates. | |||
| Argument | '<X.509 certificate in DER format, Base64 encoded>' | string | X.509 certificate(s) in DER format, encoded as a Base64 string(s). | |
| Result | '<hex string>' | string | ||
| 'validate_certificate' | Check the validity of OpenSSL certificates against those stored in the file-based OpenSSL certificate store. | |||
| Argument | '<Path to certificate store>', '<X.509 certificate in DER format, Base64 encoded>' | string | The first argument is the path to the certificate store, followed by the certificates in DER form passed as Base64 encoded strings. | |
| Result | 'false', 'true' | string | If a certificate is valid, 'true' is returned for it, 'false' otherwise. Note that there will be one less return value than arguments. | |
| Argument | [] | integer, real, string | List of arguments for the action. | |
| Result | integer, real, string | List of results returned by the action. |
query_io_interface(::IOInterfaceName, Query:Result)
| Parameter | Values | Type | Description |
|---|---|---|---|
| IOInterfaceName | 'OPC_UA' | string | HALCON I/O interface name. |
| Query | string | Parameter name of the query. | |
| 'io_device_info' | ['device:<device URL>'] | string | Returns a list of device names. The names are determined by making an OPC UA FindServers service call to an OPC UA discovery server that must be listening on TCP port 4840 of the localhost interface. |
| 'io_device_names' | <device URL> | string | Returns a list of device names that can be passed to open_io_device. The names are determined by making an OPC UA FindServers service call to an OPC UA discovery server that must be listening on TCP port 4840 of the localhost interface. |
| 'param_name' | '<parameter>'[,'<parameter>'...] | string | List of parameters that can be specified for the operator in question. |
| 'revision' | '<version>.<revision>.<build>' | string | Revision number of the OPC_UA interface. |
| Result | integer, real, string | List of result values (according to Query). |
open_io_device(::IOInterfaceName, IODeviceName, GenParamName, GenParamValue:IODeviceHandle)
| Parameter | Values | Default | Type | Description |
|---|---|---|---|---|
| IOInterfaceName | 'OPC_UA' | [] | string | HALCON I/O interface name. |
| IODeviceName | [] | string | I/O device name. | |
| GenParamName | [] | string | Dynamic parameter names. | |
| 'application_name' | '<name>' | 'HALCON OPC UA interface' | string | The client application name used for the session. |
| 'application_uri' | '<URI>' | 'HALCON OPC UA interface' | string | The client application URI used for the session. |
| 'certificate_store' | '<filesystem path>' | string | Set the path to the file-based OpenSSL certificate store to use. This should be a directory with the subdirectories 'certs' for the trusted certificates (both server and client), 'crl' for the revocation list(s), and 'private' to store the client private keys. | |
| 'client_certificate_name' | '<name>' | string | When using the file-based OpenSSL certificate store, the name of the client certificate to use. There must exist a name.der and name.pem file for the certificate and the private key, respectively. | |
| 'connect_timeout' | <milliseconds> | 5000 | integer | Timeout value in milliseconds for establishing the connection to the OPC UA server. |
| 'encrypt_password_check' | 'disable', 'enable' | 'enable' | string | This parameter prevents the client from sending unencrypted passwords without user interaction. This happens if the ServerNonce(1) is null or if the PasswordEncryptionMode is set to NONE on the server. If a server does not support encryption or does not require it due to an oversight in the configuration then this parameter should be set to 'disable'. (1) OPC UA Part 4 - Services 1.03. |
| 'event_message_queue' | 0 | handle | The user can specify a message queue in which to receive a message when certain events are triggered on the server. Setting the value to 0 (or HNULL) unregister the message queue and stops the updates. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_selector' | string | The user can specify an event from the channel or device, from which to receive a notification in the form of a HALCON message when the event triggers. For more information please refer to the section 'OPC UA Event Handling'. | ||
| 'message_security_mode' | 'none', 'sign', 'sign/encrypt' | 'none' | string | Security mode to use for the session. |
| 'product_uri' | '<URI>' | 'HALCON' | string | The client product URI used for the session. |
| 'security_policy' | 'http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep', 'http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss', 'http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15', 'http://opcfoundation.org/UA/SecurityPolicy#Basic256', 'http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256', 'http://opcfoundation.org/UA/SecurityPolicy#None' | 'http://opcfoundation.org/UA/SecurityPolicy#None' | string | Name of the security policy to use for the session. |
| 'server_certificate' | '<X.509 certificate in DER format, Base64 encoded>' | '' | string | If used as a parameter to open_io_device, sets the server certificate to use for the connection. The certificate should be in DER form, encoded as a Base64 string. The certificate must match that of the server being connected to. If used as a parameter to get_io_device_param, returns the server certificate (in DER form as a Base64 encoded string) that was passed to open_io_device when the connection was established, or an empty string if no certificate was specified. |
| 'session_locale' | '<RFC3066 locale specifier>' | 'en-US' | string | The locale to use for this session, using a language tag as specified in RFC 3066. |
| 'session_name' | '<unique session name>' | string | The session name. This should be unique for each instance of the client. | |
| 'session_timeout' | <milliseconds> | 1.2e6 | integer, float | Timeout value in milliseconds for the session. If the network connection is broken for longer than the session timeout, the session is considered disconnected. |
| 'trusted_certificate_for_user_token' | 'disable', 'enable' | 'enable' | string | This parameter prevents the client from sending unencrypted passwords without user interaction. The user token on a server must be encrypted with a certificate in the client's trusted list. This is required even if the security of the server is NONE. This flag can be used to disable the check. |
| 'user_name' | '<name>' | string | The (optional) user name for the session. When used with open_io_device or set_io_device_param, 'user_password' must be set in the same operator call. | |
| 'user_password' | '<password>' | string | The (optional) user password for the session. When used with open_io_device or set_io_device_param, 'user_name' must be set in the same operator call. | |
| 'watchdog_time' | <milliseconds> | 5000 | integer | The time between watchdog checks in milliseconds. |
| 'watchdog_timeout' | <milliseconds> | 5000 | integer | The timeout for watchdog calls in milliseconds. After one unsuccessful call the timeout will be two times this value for the next call. |
| GenParamValue | [] | integer, real, string | Dynamic parameter values. | |
| IODeviceHandle | handle | Handle of the opened I/O device. |
control_io_device(::IODeviceHandle, Action, Argument:Result)
| Parameter | Values | Default | Type | Description |
|---|---|---|---|---|
| IODeviceHandle | handle | Handle of the opened I/O device. | ||
| Action | string | Name of the action to perform. | ||
| 'namespace' | Convert the specified namespaces into the corresponding namespace indexes. | |||
| Argument | '<namespace>' | string | The namespace as a text string. | |
| Result | '<namespace index>' | integer | The namespace index, or -1 if the namespace is undefined. | |
| 'translate' | Translate an OPC UA browse path into a node id. | |||
| Argument | '<NodeId>', '<browse path>' | string | If no arguments are given, returns the root of the OPC UA node tree. Otherwise, two arguments are required. The first argument is the ID of the node the path starts at, and the second argument is the path to translate. If an empty string ('') is passed for the start node, the root of the OPC UA node tree is used. The browse path follows the syntax described in "OPC Unified Architecture, Part 4". A browse path consists of one or more subpaths. Each subpath must be written in one of the following forms: /[ns:]BrowseName - Follow any subtype of the HierarchicalReferences reference type. .[ns:]BrowseName - Follow any subtype of the Aggregates reference type. <[#][!][ns:]ReferenceType>BrowseName - Follow a reference of type ReferenceType, or a subtype thereof. If '#' is specified, the reference type must match exactly, i.e., subtypes are not followed. If '!' is specified, an inverse lookup is done. In all forms, [ns:] is an optional namespace index consisting of one or more digits followed by a colon (':'). If no namespace index is given, namespace index 0 is assumed by default. BrowseName is the target node's BrowseName attribute, while ReferenceType is the name of the reference type. If the ReferenceType or BrowseName contains any of the reserved characters '/', '.', '<', '>', '#', '!', or '&', it must be escaped by a prefixed '&'. |
|
| Result | '<NodeId>' | string | ||
| Argument | [] | integer, real, string | List of arguments for the action. | |
| Result | integer, real, string | List of result values returned by the action. |
set_io_device_param(::IODeviceHandle, GenParamName, GenParamValue:)
| Parameter | Values | Default | Type | Description |
|---|---|---|---|---|
| IODeviceHandle | handle | Handle of the opened I/O device. | ||
| GenParamName | [] | string | Parameter names. | |
| 'event_data' | string | The user can specify data to be deliver along with the event notification. The available data is determined by the event properties. For more information please refer to the section 'OPC UA Event Handling'. | ||
| 'event_message_queue' | 0 | handle | The user can specify a message queue in which to receive a message when certain events are triggered on the server. Setting the value to 0 (or HNULL) unregister the message queue and stops the updates. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_selector' | string | The user can specify an event from the channel or device, from which to receive a notification in the form of a HALCON message when the event triggers. For more information please refer to the section 'OPC UA Event Handling'. | ||
| 'user_name' | '<name>' | string | The (optional) user name for the session. When used with open_io_device or set_io_device_param, 'user_password' must be set in the same operator call. | |
| 'user_password' | '<password>' | string | The (optional) user password for the session. When used with open_io_device or set_io_device_param, 'user_name' must be set in the same operator call. | |
| GenParamValue | [] | integer, real, string, handle | Parameter values to set. |
get_io_device_param(::IODeviceHandle, GenParamName:GenParamValue)
| Parameter | Values | Type | Description |
|---|---|---|---|
| IODeviceHandle | handle | Handle of the opened I/O device. | |
| GenParamName | string | Parameter names. | |
| 'application_name' | '<name>' | string | The client application name used for the session. |
| 'application_uri' | '<URI>' | string | The client application URI used for the session. |
| 'available_event_data' | string | List of all the available data in the event selected in the event_selector.Please read the event handling section for more information. | |
| 'available_event_names' | string | List of all the available events from the channel or device.Please read the event handling section for more information. | |
| 'connect_timeout' | <milliseconds> | integer | Timeout value in milliseconds for establishing the connection to the OPC UA server. |
| 'connection_status' | 'Disconnected', 'Connected', 'NewSessionCreated', 'ConnectionWarningWatchdogTimeout', 'ConnectionErrorApiReconnect', 'ServerShutdown', 'unknown' | string | Returns the current status of the server connection as a string. |
| 'encrypt_password_check' | 'disable', 'enable' | string | This parameter prevents the client from sending unencrypted passwords without user interaction. This happens if the ServerNonce(1) is null or if the PasswordEncryptionMode is set to NONE on the server. If a server does not support encryption or does not require it due to an oversight in the configuration then this parameter should be set to 'disable'. (1) OPC UA Part 4 - Services 1.03. |
| 'endpoints' | 'endpoint_url:<server url>[|server_certificate:<certificate>]|message_security_mode:<mode>|security_policy_uri:<policy>|transport_profile_uri:<profile>|security_level:<level>' | string | If used as a parameter to get_io_device_param, returns all endpoints of the server the device is connected to. It cannot be combined with any other queries. If used as an action for control_io_interface, returns all endpoints of the server reachable via the URL given as the only argument. |
| 'event_data' | string | The user can specify data to be deliver along with the event notification. The available data is determined by the event properties. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_message_queue' | handle | The user can specify a message queue in which to receive a message when certain events are triggered on the server. Setting the value to 0 (or HNULL) unregister the message queue and stops the updates. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_selector' | string | The user can specify an event from the channel or device, from which to receive a notification in the form of a HALCON message when the event triggers. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'io_device_name' | <device URL> | string | Return the URL of the server the device is connected to. |
| 'message_security_mode' | 'none', 'sign', 'sign/encrypt' | string | Security mode to use for the session. |
| 'namespaces' | '<namespace>'[,'<namespace>',...] | string | Returns all OPC UA namespaces as a tuple of strings for the specified connection. The namespaces are returned in the same order as they are defined on the server, i.e., the fourth element of the return tuple corresponds to the fourth namespace on the server. |
| 'param_name' | '<parameter>'[,'<parameter>'...] | string | List of parameters that can be specified for the operator in question. |
| 'product_uri' | '<URI>' | string | The client product URI used for the session. |
| 'security_policy' | 'http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep', 'http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss', 'http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15', 'http://opcfoundation.org/UA/SecurityPolicy#Basic256', 'http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256', 'http://opcfoundation.org/UA/SecurityPolicy#None' | string | Name of the security policy to use for the session. |
| 'server_certificate' | '<X.509 certificate in DER format, Base64 encoded>' | string | If used as a parameter to open_io_device, sets the server certificate to use for the connection. The certificate should be in DER form, encoded as a Base64 string. The certificate must match that of the server being connected to. If used as a parameter to get_io_device_param, returns the server certificate (in DER form as a Base64 encoded string) that was passed to open_io_device when the connection was established, or an empty string if no certificate was specified. |
| 'session_locale' | '<RFC3066 locale specifier>' | string | The locale to use for this session, using a language tag as specified in RFC 3066. |
| 'session_name' | '<unique session name>' | string | The session name. This should be unique for each instance of the client. |
| 'session_timeout' | <milliseconds> | integer, float | Timeout value in milliseconds for the session. If the network connection is broken for longer than the session timeout, the session is considered disconnected. |
| 'trusted_certificate_for_user_token' | 'disable', 'enable' | string | This parameter prevents the client from sending unencrypted passwords without user interaction. The user token on a server must be encrypted with a certificate in the client's trusted list. This is required even if the security of the server is NONE. This flag can be used to disable the check. |
| 'user_name' | '<name>' | string | The (optional) user name for the session. When used with open_io_device or set_io_device_param, 'user_password' must be set in the same operator call. |
| 'user_password' | '<password>' | string | The (optional) user password for the session. When used with open_io_device or set_io_device_param, 'user_name' must be set in the same operator call. |
| 'user_token_type' | 'Anonymous', 'Certificate', 'IssuedToken', 'UserName' | string | Returns the type of user token currently used by the connection to the device. |
| 'watchdog_time' | <milliseconds> | integer | The time between watchdog checks in milliseconds. |
| 'watchdog_timeout' | <milliseconds> | integer | The timeout for watchdog calls in milliseconds. After one unsuccessful call the timeout will be two times this value for the next call. |
| GenParamValue | integer, real, string, handle | Parameter values. |
query_io_device(::IODeviceHandle, IOChannelName, Query:Result)
| 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. | |
| 'access_level' | [0..255] | integer | AccessLevel attribute of the OPC UA node(s). This attribute is mandatory for all Variable node classes. |
| 'array_dimensions' | <number> | integer | ArrayDimensions attribute of the OPC UA node(s). This attribute is optional for variable and variable type nodes. |
| 'attributes' | 'access_level', 'array_dimensions', 'contains_no_loops', 'data_type', 'description', 'display_name', 'event_notifier', 'historizing', 'inverse_name', 'is_abstract', 'minimum_sampling_interval', 'node_class', 'node_id', 'symmetric', 'user_access_level', 'user_executable', 'user_write_mask', 'value_rank', 'write_mask' | string | Returns a list of OPC UA attributes defined for the specified node. Only a single node may be specified, and no other queries may be requested in this call to query_io_device. |
| 'browse' | <NodeId>,<NodeClass>,<BrowseName>[,<NodeId>,<NodeClass>,<BrowseName>,...] | string | Returns a list of subnodes of the specified node. Only a single node may be specified. If an empty node ([]) is specified, browsing starts at the root of the OPC UA node tree. For each node, three HALCON string elements are returned - the node id, the node class, and the browse name. No other queries may be requested in this call to query_io_device. If the node id refers to a node on a different server, it is returned as an ExpandedNodeId, otherwise it is returned as a normal node id that can be used as a channel name for subsequent channel operations. |
| 'browse_name' | '<ns>:<name>' | string | BrowseName attribute of the OPC UA node(s). The browse name is returned in the form '<ns>:<name>', with <ns> being the index of the namespace the browse name is located in. This attribute is mandatory for all node classes. |
| 'contains_no_loops' | 'false', 'true' | string | ContainsNoLoops attribute of the OPC UA node(s). This attribute is mandatory for view nodes. |
| 'data_type_definition' | handle | Information about the datatype of a variable node or about a datatype node. This always includes the datatype name, the metatype and, if available, additional metadata. For structures, optionsets and unions, information about the fields is included (see parameter 'fields'). The available information is returned in a HALCON dictionary. | |
| 'data_type' | 'Boolean', 'Byte', 'ByteString', 'DataValue', 'DateTime', 'DiagnosticInfo', 'Double', 'Duration', 'ExpandedNodeId', 'ExtensionObject', 'Float', 'Guid', 'Image', 'ImageBMP', 'ImageGIF', 'ImageJPG', 'ImagePNG', 'Int16', 'Int32', 'Int64', 'Integer', 'LocalizedText', 'LocaleId', 'NodeId', 'Null', 'QualifiedName', 'SByte', 'StatusCode', 'String', 'UInt16', 'UInt32', 'UInt64', 'UInteger', 'Unknown', 'UtcTime', 'Variant', 'XmlElement' | string | The node's datatype attribute. This attribute is mandatory for data type, variable and variable type nodes. |
| 'description' | '<description>' | string | Description attribute of the OPC UA node(s). This attribute is optional for all node classes. |
| 'display_name' | '<name>' | string | DisplayName attribute of the OPC UA node(s). This attribute is mandatory for all node classes. |
| 'enum_values' | handle | If the passed node is an enumeration, return the possible numerical values together with the name and description. If the passed node is not an enum an exception will be thrown. The available information is returned in a HALCON dictionary. | |
| 'event_notifier' | <number> | integer | EventNotifier attribute of the OPC UA node(s). This attribute is mandatory for object and view nodes. |
| 'executable' | 'false', 'true' | string | Executable attribute of the OPC UA node(s). This attribute is mandatory for method nodes. |
| 'fields' | string | If the passed node is a Structure, Union or OptionSet return the fields of the datatype definition, otherwise an exception will be thrown. The available information is returned in a HALCON dictionary with a numeric key for each field. The information for each field always includes the datatype name, the metatype and, if available, additional metadata. The OPC UA attributes value_rank and, if available, array_dimensions provide information about the array characteristics of the field. | |
| 'historizing' | 'false', 'true' | string | Historizing attribute of the OPC UA node(s). This attribute is mandatory for variable nodes. |
| 'inverse_name' | '<name>' | string | InverseName attribute of the OPC UA node(s). This attribute is optional for reference type nodes. |
| 'io_channel_name' | '<name>' | string | Returns the name this channel was opened with. For OPC UA, this is the node id in XML string representation. |
| 'is_abstract' | 'false', 'true' | string | IsAbstract attribute of the OPC UA node(s). This attribute is mandatory for object type, reference type and variable type nodes. |
| 'meta_type' | 'Enumeration', 'Structure', 'Union', 'Option Set', ''<BuildIn>'' | string | Returns if the node can be interpreted as an Enumeration, Structure, Union, OptionSet or other data type. |
| 'method_arguments' | handle | Information about the input and output arguments of a method. The available information is returned in a HALCON dictionary with keys 'input_arguments' and 'output_arguments'. If the method has no input or output arguments, an empty tuple is stored under the respective key. Each argument has a name and a description. Additionally, information about the expected type is returned. | |
| 'minimum_sampling_interval' | <number> | integer, float | MinimumSamplingInterval attribute of the OPC UA node(s). This attribute is optional for variable nodes. |
| 'node_class' | 'DataType', 'Method', 'Object', 'ObjectType', 'ReferenceType', 'Unknown', 'Variable', 'VariableType', 'View' | string | NodeClass attribute of the OPC UA node(s). This attribute is mandatory for all nodes. |
| 'node_id' | '<NodeId>' | string | NodeId attribute of the OPC UA node(s). The node id is used to uniquely identify every node on a server. Use it as the channel name for query_io_device and open_io_channel. |
| 'option_set_values' | handle | If the passed node is a struct of the OptionSet data type, return the description of each bit on the bitmask on the OptionSetValues property. If the passed node is not an OptionSet, an exception will be thrown. The available information is presented in a HALCON dictionary. | |
| 'param_name' | '<parameter>'[,'<parameter>'...] | string | List of parameters that can be specified for the operator in question. |
| 'symmetric' | 'false', 'true' | string | Symmetric attribute of the OPC UA node(s). This attribute is mandatory for reference type nodes. |
| 'user_access_level' | [0..255] | integer | UserAccessLevel attribute of the OPC UA node(s). This attribute is mandatory for variable nodes. |
| 'user_executable' | 'false', 'true' | string | UserExecutable attribute of the OPC UA node(s). This attribute is mandatory for method nodes. |
| 'user_write_mask' | <bitmask> | integer | UserWriteMask attribute of the OPC UA node(s). This attribute is optional for all node classes. |
| 'value.access' | 'ro', 'wo', 'rw', 'na', 'ni' | string | Return the access of the value of a Variable node. |
| 'value_rank' | <number> | integer | ValueRank attribute of the OPC UA node(s). This attribute is mandatory for variable and variable type nodes. |
| 'write_mask' | <bitmask> | integer | WriteMask attribute of the OPC UA node(s). This attribute is optional for all node classes. |
| Result | integer, real, string | List of values (according to Query). |
open_io_channel(::IODeviceHandle, IOChannelName, GenParamName, GenParamValue:IOChannelHandle)
| 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. | |
| 'cached' | 'false', 'true' | 'false' | string | If 'true', the channel's value is not read directly from the server in response to a read_io_channel call; instead the last known value received (either published by the server, or read in response to a previous read_io_channel call) is returned. If no value has been cached for the channel, a read request is sent to the server regardless of the setting of the 'cached' parameter. The 'cached' parameter is automatically set to 'true' for subscribed channels, and to 'false' for unsubscribed channels. Note that manually setting 'cached' to 'true' for an unsubscribed channel is possible; read_io_channel will then return the cached value instead of reading the current value from the server for this channel as if it where subscribed. |
| 'discard_oldest' | 'false', 'true' | 'false' | string | Discard oldest subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'event_message_queue' | 0 | handle | The user can specify a message queue in which to receive a message when certain events are triggered on the server. Setting the value to 0 (or HNULL) unregister the message queue and stops the updates. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_selector' | string | The user can specify an event from the channel or device, from which to receive a notification in the form of a HALCON message when the event triggers. For more information please refer to the section 'OPC UA Event Handling'. | ||
| 'method_target_node' | '<NodeId>' | string | NodeId of the target object used when calling a method. Methods typically belong to a object, which provides the context for the method invocation. Methods are also allowed to belong to multiple objects. This parameter is used to specify the target object, on which the method should be invoked. To call a method, this parameter must be set, even when the target object is unique. | |
| 'priority' | [0..255] | 0 | integer | Priority subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'publishing_interval' | <milliseconds> | 0 | integer, float | Interval in which the server should publish the channel's value in milliseconds. If this parameter is set to a value greater than zero, the channel is subscribed from the server; if it is set to 0 the channel is unsubscribed. If the parameter 'sampling_interval' is set but 'publishing_interval' is not, 'publishing_interval' is set to twice the value of 'sampling_interval' by default. |
| 'queue_size' | <number> | 0 | integer | Queue size subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'sampling_interval' | <milliseconds> | 0 | integer, float | Interval in which the server should sample the channel in milliseconds. This value should be less or equal than the value of parameter 'publishing_interval'. If the parameter 'publishing_interval' is set but 'sampling_interval' is not, 'sampling_interval' is set to half the value of 'publishing_interval' by default. |
| 'use_memory_blocks' | 'disable', 'enable' | 'disable' | string | This parameter has an affect only if the open channel is a variable node that is of the data type ByteString or one of its sub-types (e.g., ImageJPG, ImagePNG, ImageGIF, etc.) or if it is an Array of the data type Byte or SByte or one of its sub-types. When this parameter is enable the value of the variable can be written or read as a HALCON memory block handle. |
| GenParamValue | [] | integer, real, string | Parameter values. | |
| IOChannelHandle | handle | Handles of the opened I/O channel. |
control_io_channel(::IOChannelHandle, Action, Argument:Result)
| Parameter | Values | Default | Type | Description |
|---|---|---|---|---|
| IOChannelHandle | handle | Handles of the opened I/O channels. | ||
| Action | string | Name of the action to perform. | ||
| 'method_call' | Call a server method. To find out if a method is executable before calling it, query for the attributes 'executable' and 'user_executable'. To call a method successfully, the provided input tuple must contain values which match the datatypes of the input arguments. The rules in section 'Converting data between HALCON and OPC UA' apply. To know which datatypes the method expects, use the io channel parameter 'arguments'. The output tuple will contain the result of the method. If the server returns a bad status code, an exception will be raised. | |||
| Argument | [] | integer, real, string | List of arguments for the action. | |
| Result | integer, real, string | List of values returned by the action. |
set_io_channel_param(::IOChannelHandle, GenParamName, GenParamValue:)
| Parameter | Values | Default | Type | Description |
|---|---|---|---|---|
| IOChannelHandle | handle | Handles of the opened I/O channels. | ||
| GenParamName | [] | string | Parameter names. | |
| 'cached' | 'false', 'true' | 'false' | string | If 'true', the channel's value is not read directly from the server in response to a read_io_channel call; instead the last known value received (either published by the server, or read in response to a previous read_io_channel call) is returned. If no value has been cached for the channel, a read request is sent to the server regardless of the setting of the 'cached' parameter. The 'cached' parameter is automatically set to 'true' for subscribed channels, and to 'false' for unsubscribed channels. Note that manually setting 'cached' to 'true' for an unsubscribed channel is possible; read_io_channel will then return the cached value instead of reading the current value from the server for this channel as if it where subscribed. |
| 'discard_oldest' | 'false', 'true' | 'false' | string | Discard oldest subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'event_data' | string | The user can specify data to be deliver along with the event notification. The available data is determined by the event properties. For more information please refer to the section 'OPC UA Event Handling'. | ||
| 'event_message_queue' | 0 | handle | The user can specify a message queue in which to receive a message when certain events are triggered on the server. Setting the value to 0 (or HNULL) unregister the message queue and stops the updates. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_namespace_filter' | string | Filter the EvenTypes available base on the namespace of the type. | ||
| 'event_selector' | string | The user can specify an event from the channel or device, from which to receive a notification in the form of a HALCON message when the event triggers. For more information please refer to the section 'OPC UA Event Handling'. | ||
| 'method_target_node' | '<NodeId>' | string | NodeId of the target object used when calling a method. Methods typically belong to a object, which provides the context for the method invocation. Methods are also allowed to belong to multiple objects. This parameter is used to specify the target object, on which the method should be invoked. To call a method, this parameter must be set, even when the target object is unique. | |
| 'priority' | [0..255] | 0 | integer | Priority subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'publishing_interval' | <milliseconds> | 0 | integer, float | Interval in which the server should publish the channel's value in milliseconds. If this parameter is set to a value greater than zero, the channel is subscribed from the server; if it is set to 0 the channel is unsubscribed. If the parameter 'sampling_interval' is set but 'publishing_interval' is not, 'publishing_interval' is set to twice the value of 'sampling_interval' by default. |
| 'queue_size' | <number> | 0 | integer | Queue size subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'sampling_interval' | <milliseconds> | 0 | integer, float | Interval in which the server should sample the channel in milliseconds. This value should be less or equal than the value of parameter 'publishing_interval'. If the parameter 'publishing_interval' is set but 'sampling_interval' is not, 'sampling_interval' is set to half the value of 'publishing_interval' by default. |
| 'use_memory_blocks' | 'disable', 'enable' | 'disable' | string | This parameter has an affect only if the open channel is a variable node that is of the data type ByteString or one of its sub-types (e.g., ImageJPG, ImagePNG, ImageGIF, etc.) or if it is an Array of the data type Byte or SByte or one of its sub-types. When this parameter is enable the value of the variable can be written or read as a HALCON memory block handle. |
| GenParamValue | [] | integer, real, string, handle | Parameter values to set. |
get_io_channel_param(::IOChannelHandle, GenParamName:GenParamValue)
| Parameter | Values | Type | Description |
|---|---|---|---|
| IOChannelHandle | handle | Handles of the opened I/O channels. | |
| GenParamName | string | Parameter names. | |
| 'access_level' | [0..255] | integer | AccessLevel attribute of the OPC UA node(s). This attribute is mandatory for all Variable node classes. |
| 'array_dimensions' | <number> | integer | ArrayDimensions attribute of the OPC UA node(s). This attribute is optional for variable and variable type nodes. |
| 'attributes' | 'access_level', 'array_dimensions', 'contains_no_loops', 'data_type', 'description', 'display_name', 'event_notifier', 'historizing', 'inverse_name', 'is_abstract', 'minimum_sampling_interval', 'node_class', 'node_id', 'symmetric', 'user_access_level', 'user_executable', 'user_write_mask', 'value_rank', 'write_mask' | string | Returns a list of OPC UA attributes defined for the specified node. Only a single node may be specified, and no other queries may be requested in this call to query_io_device. |
| 'available_event_data' | string | List of all the available data in the event selected in the event_selector.Please read the event handling section for more information. | |
| 'available_event_names' | string | List of all the available events from the channel or device.Please read the event handling section for more information. | |
| 'browse_name' | '<ns>:<name>' | string | BrowseName attribute of the OPC UA node(s). The browse name is returned in the form '<ns>:<name>', with <ns> being the index of the namespace the browse name is located in. This attribute is mandatory for all node classes. |
| 'cached' | 'false', 'true' | string | If 'true', the channel's value is not read directly from the server in response to a read_io_channel call; instead the last known value received (either published by the server, or read in response to a previous read_io_channel call) is returned. If no value has been cached for the channel, a read request is sent to the server regardless of the setting of the 'cached' parameter. The 'cached' parameter is automatically set to 'true' for subscribed channels, and to 'false' for unsubscribed channels. Note that manually setting 'cached' to 'true' for an unsubscribed channel is possible; read_io_channel will then return the cached value instead of reading the current value from the server for this channel as if it where subscribed. |
| 'contains_no_loops' | 'false', 'true' | string | ContainsNoLoops attribute of the OPC UA node(s). This attribute is mandatory for view nodes. |
| 'data_type' | 'Boolean', 'Byte', 'ByteString', 'DataValue', 'DateTime', 'DiagnosticInfo', 'Double', 'Duration', 'ExpandedNodeId', 'ExtensionObject', 'Float', 'Guid', 'Image', 'ImageBMP', 'ImageGIF', 'ImageJPG', 'ImagePNG', 'Int16', 'Int32', 'Int64', 'Integer', 'LocalizedText', 'LocaleId', 'NodeId', 'Null', 'QualifiedName', 'SByte', 'StatusCode', 'String', 'UInt16', 'UInt32', 'UInt64', 'UInteger', 'Unknown', 'UtcTime', 'Variant', 'XmlElement' | string | The node's datatype attribute. This attribute is mandatory for data type, variable and variable type nodes. |
| 'data_type_definition' | handle | Information about the datatype of a variable node or about a datatype node. This always includes the datatype name, the metatype and, if available, additional metadata. For structures, optionsets and unions, information about the fields is included (see parameter 'fields'). The available information is returned in a HALCON dictionary. | |
| 'description' | '<description>' | string | Description attribute of the OPC UA node(s). This attribute is optional for all node classes. |
| 'discard_oldest' | 'false', 'true' | string | Discard oldest subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'display_name' | '<name>' | string | DisplayName attribute of the OPC UA node(s). This attribute is mandatory for all node classes. |
| 'enum_values' | handle | If the passed node is an enumeration, return the possible numerical values together with the name and description. If the passed node is not an enum an exception will be thrown. The available information is returned in a HALCON dictionary. | |
| 'event_data' | string | The user can specify data to be deliver along with the event notification. The available data is determined by the event properties. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_message_queue' | handle | The user can specify a message queue in which to receive a message when certain events are triggered on the server. Setting the value to 0 (or HNULL) unregister the message queue and stops the updates. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'event_namespace_filter' | string | Filter the EvenTypes available base on the namespace of the type. | |
| 'event_notifier' | <number> | integer | EventNotifier attribute of the OPC UA node(s). This attribute is mandatory for object and view nodes. |
| 'event_selector' | string | The user can specify an event from the channel or device, from which to receive a notification in the form of a HALCON message when the event triggers. For more information please refer to the section 'OPC UA Event Handling'. | |
| 'executable' | 'false', 'true' | string | Executable attribute of the OPC UA node(s). This attribute is mandatory for method nodes. |
| 'fields' | string | If the passed node is a Structure, Union or OptionSet return the fields of the datatype definition, otherwise an exception will be thrown. The available information is returned in a HALCON dictionary with a numeric key for each field. The information for each field always includes the datatype name, the metatype and, if available, additional metadata. The OPC UA attributes value_rank and, if available, array_dimensions provide information about the array characteristics of the field. | |
| 'historizing' | 'false', 'true' | string | Historizing attribute of the OPC UA node(s). This attribute is mandatory for variable nodes. |
| 'inverse_name' | '<name>' | string | InverseName attribute of the OPC UA node(s). This attribute is optional for reference type nodes. |
| 'io_channel_name' | '<name>' | string | Returns the name this channel was opened with. For OPC UA, this is the node id in XML string representation. |
| 'is_abstract' | 'false', 'true' | string | IsAbstract attribute of the OPC UA node(s). This attribute is mandatory for object type, reference type and variable type nodes. |
| 'meta_type' | 'Enumeration', 'Structure', 'Union', 'Option Set', ''<BuildIn>'' | string | Returns if the node can be interpreted as an Enumeration, Structure, Union, OptionSet or other data type. |
| 'method_arguments' | handle | Information about the input and output arguments of a method. The available information is returned in a HALCON dictionary with keys 'input_arguments' and 'output_arguments'. If the method has no input or output arguments, an empty tuple is stored under the respective key. Each argument has a name and a description. Additionally, information about the expected type is returned. | |
| 'method_target_node' | '<NodeId>' | string | NodeId of the target object used when calling a method. Methods typically belong to a object, which provides the context for the method invocation. Methods are also allowed to belong to multiple objects. This parameter is used to specify the target object, on which the method should be invoked. To call a method, this parameter must be set, even when the target object is unique. |
| 'minimum_sampling_interval' | <number> | integer, float | MinimumSamplingInterval attribute of the OPC UA node(s). This attribute is optional for variable nodes. |
| 'node_class' | 'DataType', 'Method', 'Object', 'ObjectType', 'ReferenceType', 'Unknown', 'Variable', 'VariableType', 'View' | string | NodeClass attribute of the OPC UA node(s). This attribute is mandatory for all nodes. |
| 'node_id' | '<NodeId>' | string | NodeId attribute of the OPC UA node(s). The node id is used to uniquely identify every node on a server. Use it as the channel name for query_io_device and open_io_channel. |
| 'option_set_values' | handle | If the passed node is a struct of the OptionSet data type, return the description of each bit on the bitmask on the OptionSetValues property. If the passed node is not an OptionSet, an exception will be thrown. The available information is presented in a HALCON dictionary. | |
| 'param_name' | '<parameter>'[,'<parameter>'...] | string | List of parameters that can be specified for the operator in question. |
| 'priority' | [0..255] | integer | Priority subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'publishing_interval' | <milliseconds> | integer, float | Interval in which the server should publish the channel's value in milliseconds. If this parameter is set to a value greater than zero, the channel is subscribed from the server; if it is set to 0 the channel is unsubscribed. If the parameter 'sampling_interval' is set but 'publishing_interval' is not, 'publishing_interval' is set to twice the value of 'sampling_interval' by default. |
| 'queue_size' | <number> | integer | Queue size subscription property. If this parameter is set, at least one of the parameters 'publishing_interval' or 'sampling_interval' must also be set. |
| 'sampling_interval' | <milliseconds> | integer, float | Interval in which the server should sample the channel in milliseconds. This value should be less or equal than the value of parameter 'publishing_interval'. If the parameter 'publishing_interval' is set but 'sampling_interval' is not, 'sampling_interval' is set to half the value of 'publishing_interval' by default. |
| 'symmetric' | 'false', 'true' | string | Symmetric attribute of the OPC UA node(s). This attribute is mandatory for reference type nodes. |
| 'use_memory_blocks' | 'disable', 'enable' | string | This parameter has an affect only if the open channel is a variable node that is of the data type ByteString or one of its sub-types (e.g., ImageJPG, ImagePNG, ImageGIF, etc.) or if it is an Array of the data type Byte or SByte or one of its sub-types. When this parameter is enable the value of the variable can be written or read as a HALCON memory block handle. |
| 'user_access_level' | [0..255] | integer | UserAccessLevel attribute of the OPC UA node(s). This attribute is mandatory for variable nodes. |
| 'user_executable' | 'false', 'true' | string | UserExecutable attribute of the OPC UA node(s). This attribute is mandatory for method nodes. |
| 'user_write_mask' | <bitmask> | integer | UserWriteMask attribute of the OPC UA node(s). This attribute is optional for all node classes. |
| 'value_rank' | <number> | integer | ValueRank attribute of the OPC UA node(s). This attribute is mandatory for variable and variable type nodes. |
| 'write_mask' | <bitmask> | integer | WriteMask attribute of the OPC UA node(s). This attribute is optional for all node classes. |
| GenParamValue | integer, real, string, handle | Parameter values. |
read_io_channel(::IOChannelHandle:Value, Status)
| 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 as returned by the OPC UA communication stack. |
write_io_channel(::IOChannelHandle, Value:Status)
| 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 as returned by the OPC UA communication stack. |
close_io_channel(::IOChannelHandle:)
| Parameter | Type | Description |
|---|---|---|
| IOChannelHandle | handle | Handles of the opened I/O channels. |
close_io_device(::IODeviceHandle:)
| Parameter | Type | Description |
|---|---|---|
| IODeviceHandle | handle | Handle of the opened I/O device. |
You can request the source for those third-party libraries licensed under GPL or LGPL via email to info@mvtec.com with the subject "Request source code of third-party libraries".
On Linux, you can use the system-provided OpenSSL libraries if they are binary compatible with OpenSSL 3 by removing libcrypto.so.3 and libssl.so.3 from the directory $HALCONROOT/lib/$HALCONARCH/thirdparty.
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.