Qt OPC UA Overview

OPC UA 是用于工业应用程序数据建模和数据交换的协议。

OPC UA 服务器提供对由参考连接节点网格,组织数据的访问。使用不同引用类型和包含元数据的节点,使客户端能够在无需提前知道其结构的情况下导航和解释数据。

Each node has a unique identifier and attributes that can be read and written. Among others, there are 变量 nodes that store values and callable 方法 nodes with attached nodes describing parameters and return values. Notifications in case of events and monitoring of Variable nodes for value changes are offered too.

Complex objects can be created by combining nodes using references. Inheritance is also possible. OPC UA offers support for pre-made models that can be extended to fit special needs.

OPC UA is the platform-independent successor of OPC Classic intended for usage on all levels, from embedded sensors up to manufacturing execution and enterprise resource planning systems. It has a service-oriented architecture based on standardized messages for service requests and responses. There are different ways for these messages to be encoded and transported over the network. The most common way is binary encoding over TCP.

从 OPC UA 协议实现的特征

The following table summarizes the features of OPC UA that are supported by Qt OPC UA.

特征 Open62541 插件 UACpp plugin
读取 X X
批量读取 X X
写入 X X
批量写入 X X
多维数组 X X
浏览 X X
数据改变订阅 X X
事件订阅 X X
修改订阅/监视项 X X
方法调用 X X
浏览路径分辨率 X X
GetEndpoints X X
FindServers X X
NodeManagement X X

数据类型

A subset of the OPC UA data types is currently supported in Qt OPC UA. Most of them are available with all backends.

数据类型 Open62541 插件 UACpp plugin Qt OPC UA data type
Int16, Int32, Int64 X X 直接使用
UInt16, UInt32, UInt64 X X 直接使用
Byte X X quint8
SByte X X qint8
布尔 X X 直接使用
Double X X 直接使用
Float X X 直接使用
字符串 X X QString
LocalizedText X X QOpcUaLocalizedText
DateTime X X QDateTime
ByteString X X QByteArray
XmlElement X X QString
NodeId X X QString
GUID X X QUuid
QualifiedName X X QOpcUaQualifiedName
StatusCode X X QOpcUa::UaStatusCode
Range X X QOpcUaRange
EUInformation X X QOpcUaEUInformation
ComplexNumber X X QOpcUaComplexNumber
DoubleComplexNumber X X QOpcUaDoubleComplexNumber
AxisInformation X X QOpcUaAxisInformation
XV X X QOpcUaXValue
自变量 X X QOpcUaArgument
ExpandedNodeId X X QOpcUaExpandedNodeId
ExtensionObject X X QOpcUaExtensionObject

类和所有权

Two important classes are exposed to the user: QOpcUaClient and QOpcUaNode .

Objects of both classes are owned by the user and must be deleted when they are no longer needed.

日志类别

The following table summarizes the logging categories that are used by Qt OPC UA.

日志类别 描述
qt.opcua Plugin independent messages generated by QOpcUaProvider and QOpcUaClient
qt.opcua.plugins.open62541 Messages generated by the open62541 plugin
qt.opcua.plugins.uacpp Messages generated by the UACpp plugin

Open62541 特定日志类别

The open62541 sdk logging categories depend on the log level for open62541, which is configured at compile time. The default is 300, which enables: info, warning, error and critical. To obtain less or more verbose output, the open62541 sdk needs to be rebuilt with a different configuration.

The following table shows the logging categories used by open62541:

Open62541 Logging Category 描述
qt.opcua.plugins.open62541.sdk.network Messages generated by the open62541 network
qt.opcua.plugins.open62541.sdk.securechannel Messages generated by the open62541 channel
qt.opcua.plugins.open62541.sdk.session Messages generated by the open62541 session
qt.opcua.plugins.open62541.sdk.server Messages generated by open62541 server components
qt.opcua.plugins.open62541.sdk.client Messages generated by the open62541 client
qt.opcua.plugins.open62541.sdk.userland Messages generated by the open62541 userland
qt.opcua.plugins.open62541.sdk.securitypolicy Messages generated by the open62541 security policies

许可

The Qt OPC UA module is available under commercial licenses from Qt 公司 。此外,它在自由软件许可下也是可用的。这些自由软件许可是 GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。

Qt OPC UA in Qt 6.5.1 may contain third party modules under following permissive licenses:

Open62541, version 1.3.4 Mozilla Public License 2.0 and Creative Commons Zero v1.0 Universal and Creative Commons Attribution Non Commercial Share Alike 4.0 International and BSD 3-Clause "New" or "Revised" License and Apache License 2.0 and MIT License

Linking to external libraries involves licenses from the backend providers.

Open62541

The Open62541 plugin is available under the same licenses as Qt OPC UA. The Open62541 library itself is licensed under Mozilla 公共许可第 2.0 版 .

The security support is provided by the OpenSSL plugins of the open62541 library. If the open62541 plugin is built with security support and OpenSSL is not available on the target system, the open62541 plugin will fail to load.

UA CPP

The UA CPP plugin is available under commercial licenses from Qt 公司 。此外,它是可用的根据 GNU GPL (一般公共许可) 第 3 版 。UA CPP 库本身可用于商业许可来自 Unified Automation .