class QOpcUaWriteItem#

This class stores the options for a write operation. More

Synopsis#

Methods#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

A write operation on an OPC UA server overwrites the entire value or a certain index range of the value of an attribute of a node on the server. This class contains the necessary information for the backend to make a write request to the server.

One or multiple objects of this class make up the request of a writeNodeAttributes() operation.

__init__(other)#
Parameters:

otherQOpcUaWriteItem

Creates a new write item from other.

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

  • attributeNodeAttribute

  • value – object

  • typeTypes

  • indexRange – str

Creates a write item for the attribute attribute from node nodeId. The value value of type type will be written at position indexRange of attribute.

__init__()

Default constructs a write item with no parameters set.

attribute()#
Return type:

NodeAttribute

Returns the attribute of the write item.

See also

setAttribute()

hasStatusCode()#
Return type:

bool

Returns true if a status code for the value to write has been set.

indexRange()#
Return type:

str

Returns the index range of the write item.

See also

setIndexRange()

nodeId()#
Return type:

str

Returns the node id of the write item.

See also

setNodeId()

serverTimestamp()#
Return type:

QDateTime

Returns the server timestamp for the value to write.

setAttribute(attribute)#
Parameters:

attributeNodeAttribute

Sets the attribute of the write item to attribute.

See also

attribute()

setIndexRange(indexRange)#
Parameters:

indexRange – str

Sets the index range of the write item to indexRange.

See also

indexRange()

setNodeId(nodeId)#
Parameters:

nodeId – str

Sets the node id of the write item to nodeId.

See also

nodeId()

setServerTimestamp(serverTimestamp)#
Parameters:

serverTimestampQDateTime

Sets the server timestamp for the value to write to serverTimestamp. If the server timestamp is invalid, it is ignored by the client and not sent to the server. If the server doesn’t support writing timestamps, the write operation for this item will fail with status code BadWriteNotSupported .

setSourceTimestamp(sourceTimestamp)#
Parameters:

sourceTimestampQDateTime

Sets the source timestamp for the value to write to sourceTimestamp. If the source timestamp is invalid, it is ignored by the client and not sent to the server. If the server doesn’t support writing timestamps, the write operation for this item will fail with status code BadWriteNotSupported .

setStatusCode(statusCode)#
Parameters:

statusCodeUaStatusCode

Sets the status code for the value to write to statusCode. If no status code is set, no status code is sent to the server.

See also

statusCode()

setType(type)#
Parameters:

typeTypes

Sets the type of the value of the write item to type.

See also

type()

setValue(value)#
Parameters:

value – object

Sets the value of the write item to value. If given, the type information from setType() will be used in converting the value to a SDK specific data type.

See also

value() setType()

setValue(value, type)
Parameters:
  • value – object

  • typeTypes

Sets the value of the write item to

  • and

  • the type of the value to type.

sourceTimestamp()#
Return type:

QDateTime

Returns the source timestamp for the value to write.

statusCode()#
Return type:

UaStatusCode

Returns the status code for the value to write.

See also

setStatusCode()

type()#
Return type:

Types

Returns the type of the value of the write item.

See also

setType()

value()#
Return type:

object

Returns the value of the write item.

See also

setValue()