In questa pagina

QOpcUaWriteItem Class

Questa classe memorizza le opzioni relative a un'operazione di scrittura. Per saperne di più...

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

Funzioni pubbliche

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)

Descrizione dettagliata

Un'operazione di scrittura su un server OPC UA sovrascrive l'intero valore o un determinato intervallo di indici del valore di un attributo di un nodo sul server. Questa classe contiene le informazioni necessarie affinché il backend possa effettuare una richiesta di scrittura al server.

Uno o più oggetti di questa classe costituiscono la richiesta di un'operazione QOpcUaClient::writeNodeAttributes().

Vedi anche QOpcUaClient::writeNodeAttributes() e QOpcUaWriteResult.

Documentazione delle funzioni membro

QOpcUaWriteItem::QOpcUaWriteItem()

Il valore predefinito crea un elemento di scrittura senza parametri specificati.

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

Crea una voce di scrittura per l'attributo attribute dal nodo nodeId. Il valore value, di tipo type, verrà scritto nella posizione indexRange di attribute.

QOpcUaWriteItem::QOpcUaWriteItem(const QOpcUaWriteItem &other)

Crea una nuova voce di scrittura da other.

QOpcUa::NodeAttribute QOpcUaWriteItem::attribute() const

Restituisce l'attributo dell'elemento di scrittura.

Vedi anche setAttribute().

bool QOpcUaWriteItem::hasStatusCode() const

Restituisce true se è stato impostato un codice di stato per il valore da scrivere.

QString QOpcUaWriteItem::indexRange() const

Restituisce l'intervallo di indici della voce di scrittura.

Vedi anche setIndexRange().

QString QOpcUaWriteItem::nodeId() const

Restituisce l'ID del nodo dell'elemento di scrittura.

Vedi anche setNodeId().

QDateTime QOpcUaWriteItem::serverTimestamp() const

Restituisce il timestamp del server relativo al valore da scrivere.

Vedi anche setServerTimestamp().

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

Imposta l'attributo dell'elemento di scrittura su " attribute".

Vedi anche attribute().

void QOpcUaWriteItem::setIndexRange(const QString &indexRange)

Imposta l'intervallo di indici della voce di scrittura su indexRange.

Vedi anche indexRange().

void QOpcUaWriteItem::setNodeId(const QString &nodeId)

Imposta l'ID del nodo dell'elemento di scrittura su nodeId.

Vedi anche nodeId().

void QOpcUaWriteItem::setServerTimestamp(const QDateTime &serverTimestamp)

Imposta il timestamp del server per il valore da scrivere in serverTimestamp. Se il timestamp del server non è valido, viene ignorato dal client e non inviato al server. Se il server non supporta la scrittura dei timestamp, l'operazione di scrittura per questo elemento fallirà con il codice di stato BadWriteNotSupported.

Vedi anche serverTimestamp().

void QOpcUaWriteItem::setSourceTimestamp(const QDateTime &sourceTimestamp)

Imposta il timestamp di origine per il valore da scrivere in sourceTimestamp. Se il timestamp di origine non è valido, viene ignorato dal client e non inviato al server. Se il server non supporta la scrittura dei timestamp, l'operazione di scrittura per questo elemento fallirà con il codice di stato BadWriteNotSupported.

Vedi anche sourceTimestamp().

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

Imposta il codice di stato per il valore da scrivere su statusCode. Se non viene impostato alcun codice di stato, al server non viene inviato alcun codice di stato.

Vedi anche statusCode().

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

Imposta il tipo del valore dell'elemento di scrittura su “ type ”.

Vedi anche type().

void QOpcUaWriteItem::setValue(const QVariant &value)

Imposta il valore dell'elemento di scrittura su value. Se specificato, le informazioni sul tipo fornite da setType() verranno utilizzate per convertire il valore in un tipo di dati specifico dell'SDK.

Vedi anche value() e setType().

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

Imposta il valore dell'elemento di scrittura su

CostanteDescrizione
andil tipo del valore da assegnare a type.

QDateTime QOpcUaWriteItem::sourceTimestamp() const

Restituisce il timestamp di origine del valore da scrivere.

Vedi anche setSourceTimestamp().

QOpcUa::UaStatusCode QOpcUaWriteItem::statusCode() const

Restituisce il codice di stato relativo al valore da scrivere.

Vedi anche setStatusCode().

QOpcUa::Types QOpcUaWriteItem::type() const

Restituisce il tipo del valore dell'elemento di scrittura.

Vedi anche setType().

QVariant QOpcUaWriteItem::value() const

Restituisce il valore dell'elemento di scrittura.

Vedi anche setValue().

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

Imposta i valori provenienti da rhs in questa voce di scrittura.

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