PySide6.QtOpcUa.QOpcUaWriteItem

class QOpcUaWriteItem

此类存储写操作的选项。更多

概要

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

在OPC UA服务器上的写操作会覆盖服务器上节点属性的整个值或某个索引范围的值。此类包含后端向服务器发出写请求所需的信息。

一个或多个此类的对象组成了writeNodeAttributes()操作的请求。

__init__()

默认构造一个没有设置参数的写入项。

__init__(other)
Parameters:

其他QOpcUaWriteItem

other 创建一个新的写入项。

__init__(nodeId, attribute, value[, type=QOpcUa.Types.Undefined[, indexRange=""]])
Parameters:

为节点 nodeId 的属性 attribute 创建一个写入项。类型为 type 的值 value 将被写入到 attributeindexRange 位置。

attribute()
Return type:

NodeAttribute

返回写入项的属性。

另请参阅

setAttribute()

hasStatusCode()
Return type:

布尔

如果已设置要写入值的状态码,则返回true。

indexRange()
Return type:

字符串

返回写入项的索引范围。

另请参阅

setIndexRange()

nodeId()
Return type:

字符串

返回写入项的节点ID。

另请参阅

setNodeId()

serverTimestamp()
Return type:

QDateTime

返回要写入的值的服务器时间戳。

另请参阅

setServerTimestamp()

setAttribute(attribute)
Parameters:

属性NodeAttribute

将写入项的属性设置为 attribute

另请参阅

attribute()

setIndexRange(indexRange)
Parameters:

indexRange – str

将写入项的索引范围设置为indexRange

另请参阅

indexRange()

setNodeId(nodeId)
Parameters:

nodeId – str

将写入项的节点ID设置为nodeId

另请参阅

nodeId()

setServerTimestamp(serverTimestamp)
Parameters:

serverTimestampQDateTime

设置要写入serverTimestamp的服务器时间戳。如果服务器时间戳无效,客户端将忽略它并且不会发送到服务器。如果服务器不支持写入时间戳,此项目的写入操作将失败,状态码为BadWriteNotSupported

另请参阅

serverTimestamp()

setSourceTimestamp(sourceTimestamp)
Parameters:

sourceTimestampQDateTime

设置要写入sourceTimestamp的值的源时间戳。如果源时间戳无效,客户端将忽略它并且不会发送到服务器。如果服务器不支持写入时间戳,此项目的写入操作将失败,状态码为BadWriteNotSupported

另请参阅

sourceTimestamp()

setStatusCode(statusCode)
Parameters:

statusCodeUaStatusCode

设置要写入statusCode的状态码。如果未设置状态码,则不会向服务器发送状态码。

另请参阅

statusCode()

setType(type)
Parameters:

类型Types

将写入项的值类型设置为 type

另请参阅

type()

setValue(value)
Parameters:

– 对象

将写入项的值设置为value。如果提供了类型信息,setType()将用于将值转换为SDK特定的数据类型。

另请参阅

value() setType()

setValue(value, type)
Parameters:
  • value – 对象

  • type类型

设置写入项的值为

  • 值的类型为 type

sourceTimestamp()
Return type:

QDateTime

返回要写入值的源时间戳。

另请参阅

setSourceTimestamp()

statusCode()
Return type:

UaStatusCode

返回要写入值的状态码。

另请参阅

setStatusCode()

type()
Return type:

类型

返回写入项值的类型。

另请参阅

setType()

value()
Return type:

对象

返回写入项的值。

另请参阅

setValue()