このページでは

QOpcUaWriteItem Class

このクラスは、書き込み操作のオプションを格納します。詳細...

ヘッダー: #include <QOpcUaWriteItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua

パブリック関数

QOpcUaWriteItem()
QOpcUaWriteItem(const QString &nodeId, QOpcUa::NodeAttribute attribute, const QVariant &value, QOpcUa::Types type = QOpcUa::Types::Undefined, const QString &indexRange = QString())
QOpcUaWriteItem(const QOpcUaWriteItem &other)
QOpcUa::NodeAttribute attribute() const
bool hasStatusCode() const
QString indexRange() const
QString nodeId() const
QDateTime serverTimestamp() const
void setAttribute(QOpcUa::NodeAttribute attribute)
void setIndexRange(const QString &indexRange)
void setNodeId(const QString &nodeId)
void setServerTimestamp(const QDateTime &serverTimestamp)
void setSourceTimestamp(const QDateTime &sourceTimestamp)
void setStatusCode(QOpcUa::UaStatusCode statusCode)
void setType(QOpcUa::Types type)
void setValue(const QVariant &value)
void setValue(const QVariant &value, QOpcUa::Types type)
QDateTime sourceTimestamp() const
QOpcUa::UaStatusCode statusCode() const
QOpcUa::Types type() const
QVariant value() const
QOpcUaWriteItem &operator=(const QOpcUaWriteItem &rhs)

詳細な説明

OPC UA サーバーに対する書き込み操作は、サーバー上のノードの属性の値全体、またはその値の特定のインデックス範囲を上書きします。このクラスには、バックエンドがサーバーに対して書き込み要求を行うために必要な情報が含まれています。

このクラスの1つまたは複数のオブジェクトが、QOpcUaClient::writeNodeAttributes() 操作のリクエストを構成します。

「 QOpcUaClient::writeNodeAttributes()」および「QOpcUaWriteResult 」も参照してください 。

メンバ関数のドキュメント

QOpcUaWriteItem::QOpcUaWriteItem()

default は、パラメータが設定されていない書き込み項目を生成します。

QOpcUaWriteItem::QOpcUaWriteItem(const QString &nodeId, QOpcUa::NodeAttribute attribute, const QVariant &value, QOpcUa::Types type = QOpcUa::Types::Undefined, const QString &indexRange = QString())

ノード `nodeId` の属性 `attribute ` に対して書き込み項目を作成します。型 `type ` の値 `value ` が、attribute の位置 `indexRange ` に書き込まれます。

QOpcUaWriteItem::QOpcUaWriteItem(const QOpcUaWriteItem &other)

other から新しい書き込み項目を作成します。

QOpcUa::NodeAttribute QOpcUaWriteItem::attribute() const

書き込み項目の属性を返します。

setAttribute()も参照してください 。

bool QOpcUaWriteItem::hasStatusCode() const

書き込み対象の値のステータスコードが設定されている場合、true を返します。

QString QOpcUaWriteItem::indexRange() const

書き込み項目のインデックス範囲を返します。

setIndexRange()も参照してください 。

QString QOpcUaWriteItem::nodeId() const

書き込み項目のノードIDを返します。

setNodeId()も参照してください 。

QDateTime QOpcUaWriteItem::serverTimestamp() const

書き込み対象の値に対するサーバーのタイムスタンプを返します。

setServerTimestamp()も参照してください 。

void QOpcUaWriteItem::setAttribute(QOpcUa::NodeAttribute attribute)

書き込み項目の属性をattribute に設定します。

attribute()も参照してください 。

void QOpcUaWriteItem::setIndexRange(const QString &indexRange)

書き込み項目のインデックス範囲をindexRange に設定します。

indexRange()も参照してください 。

void QOpcUaWriteItem::setNodeId(const QString &nodeId)

書き込み項目のノードIDをnodeId に設定します。

nodeId()も参照してください 。

void QOpcUaWriteItem::setServerTimestamp(const QDateTime &serverTimestamp)

serverTimestamp に書き込む値のサーバータイムスタンプを設定します。サーバータイムスタンプが無効な場合、クライアントによって無視され、サーバーには送信されません。サーバーがタイムスタンプの書き込みに対応していない場合、この項目の書き込み操作はステータスコードBadWriteNotSupported で失敗します。

serverTimestamp()も参照してください 。

void QOpcUaWriteItem::setSourceTimestamp(const QDateTime &sourceTimestamp)

sourceTimestamp に書き込む値のソースタイムスタンプを設定します。ソースタイムスタンプが無効な場合、クライアントによって無視され、サーバーには送信されません。サーバーがタイムスタンプの書き込みをサポートしていない場合、この項目の書き込み操作はステータスコードBadWriteNotSupported で失敗します。

sourceTimestamp()も参照してください 。

void QOpcUaWriteItem::setStatusCode(QOpcUa::UaStatusCode statusCode)

statusCode に書き込む値のステータスコードを設定します。ステータスコードが設定されていない場合、サーバーにはステータスコードが送信されません。

statusCode()も参照してください 。

void QOpcUaWriteItem::setType(QOpcUa::Types type)

書き込み項目の値の型を「type 」に設定します。

type()も参照してください 。

void QOpcUaWriteItem::setValue(const QVariant &value)

書き込み項目の値を `value` に設定します。指定された場合、値を SDK 固有のデータ型に変換する際に、setType() から取得した型情報が使用されます。

value() およびsetType()も参照してください 。

void QOpcUaWriteItem::setValue(const QVariant &value, QOpcUa::Types type)

書き込み項目の値を

定数説明
and値の型をtype に設定します。

QDateTime QOpcUaWriteItem::sourceTimestamp() const

書き込み対象の値のソースタイムスタンプを返します。

setSourceTimestamp()も参照してください 。

QOpcUa::UaStatusCode QOpcUaWriteItem::statusCode() const

書き込み対象の値に対するステータスコードを返します。

setStatusCode()も参照してください 。

QOpcUa::Types QOpcUaWriteItem::type() const

書き込み項目の値の型を返します。

setType()も参照してください 。

QVariant QOpcUaWriteItem::value() const

書き込み項目の値を返します。

setValue()も参照してください 。

QOpcUaWriteItem &QOpcUaWriteItem::operator=(const QOpcUaWriteItem &rhs)

この書き込み項目に、rhs の値を設定します。

© 2026 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.