Node QML Type

代表服务器上的一个节点。更多

Import Statement: import QtOpcUa
Since: QtOpcUa 5.12
Inherited By:

MethodNode and ValueNode

Status: Deprecated since 6.9

自 QtOpcUa 6.9 起,该类型已被弃用。我们强烈建议不要在新代码中使用它。

属性

方法

详细说明

import QtOpcUa as QtOpcUa

QtOpcUa.Node {
    nodeId : QtOpcUa.NodeId {
        identifier: "s=Example.Method"
        ns: "Example Namespace"
    }
    connection: myConnection
}

属性文档

Status : enumeration

节点的状态。

常数说明
Node.Status.Valid节点已准备就绪
Node.Status.InvalidNodeId节点 ID 无效
Node.Status.NoConnection未连接到服务器
Node.Status.InvalidNodeType服务器上的节点类型与 QML 类型不匹配
Node.Status.InvalidClient连接客户端无效
Node.Status.FailedToResolveNode节点解析失败
Node.Status.InvalidObjectNode对象节点无效或其类型与预期类型不符
Node.Status.FailedToReadAttributes读取属性失败
Node.Status.FailedToSetupMonitoring设置监控失败

另请参阅 statuserrorMessage


browseName : string

节点的浏览名称。如果信息不可用,则返回空字符串。


connection : Connection

节点实例使用的连接。当相关连接已与服务器建立连接时,节点将自动被访问。

如果未设置该属性,则将使用默认连接(如果有)。

另请参阅 ConnectionConnection::defaultConnection


description : LocalizedText

节点描述。如果信息不可用,将返回一个默认构造的LocalizedText


displayName : LocalizedText

节点的本地化文本。如果没有相关信息,则返回默认的LocalizedText


errorMessage : string [read-only]

当前状态代码的字符串表示。

另请参阅 statusStatus


eventFilter : EventFilter

事件过滤器允许根据特定条件监控服务器上的事件。

另请参阅 EventFilter


nodeClass : QOpcUa::NodeClass [read-only]

节点的节点类别。如果信息不可用,QtOpcUa.Constants.NodeClass.Undefined


nodeId : NodeId

要使用的服务器上节点的 ID。可以是绝对节点 ID,也可以是相对节点 ID。

另请参阅 NodeIdRelativeNodeId


readyToUse : bool [read-only]

该属性返回节点是否已准备就绪可以使用。在与服务器建立成功连接并成功设置节点后,该属性会出现一次。


status : Status [read-only]

节点的当前状态。节点只有在状态为Valid 时才能使用。在其他任何情况下,它都表示出错。

另请参阅 errorMessageStatus


方法文档

Date getServerTimestamp(Constants::NodeAttribute attribute)

返回给定attribute 的服务器时间戳。


Date getSourceTimestamp(QOpcUa::NodeAttribute attribute)

返回给定attribute 的源时间戳。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.