In questa pagina

QModbusExceptionResponse Class

QModbusExceptionResponse è una classe contenitore che racchiude la funzione e il codice di errore all'interno di un'ADU Modbus. Per saperne di più...

Intestazione: #include <QModbusExceptionResponse>
CMake: find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
qmake: QT += serialbus
Eredita da: QModbusResponse

Funzioni pubbliche

QModbusExceptionResponse()
QModbusExceptionResponse(const QModbusPdu &pdu)
QModbusExceptionResponse(QModbusPdu::FunctionCode code, QModbusPdu::ExceptionCode ec)
void setExceptionCode(QModbusPdu::ExceptionCode ec)

Funzioni pubbliche reimplementate

virtual void setFunctionCode(QModbusPdu::FunctionCode c) override

Descrizione dettagliata

Una tipica risposta di tipo QModbusExceptionResponse può presentarsi come segue:

QModbusExceptionResponse exception(QModbusExceptionResponse::ReportServerId,
    QModbusExceptionResponse::ServerDeviceFailure);

Documentazione delle funzioni membro

[constexpr noexcept default] QModbusExceptionResponse::QModbusExceptionResponse()

Crea un oggetto QModbusExceptionResponse non valido.

QModbusExceptionResponse::QModbusExceptionResponse(const QModbusPdu &pdu)

Crea una copia di pdu.

QModbusExceptionResponse::QModbusExceptionResponse(QModbusPdu::FunctionCode code, QModbusPdu::ExceptionCode ec)

Crea un oggetto `QModbusExceptionResponse` con il codice funzione impostato su ` code ` e il codice di errore dell'eccezione impostato su ` ec`.

void QModbusExceptionResponse::setExceptionCode(QModbusPdu::ExceptionCode ec)

Imposta il codice di eccezione della risposta su ec.

[override virtual] void QModbusExceptionResponse::setFunctionCode(QModbusPdu::FunctionCode c)

Reimplementa: QModbusPdu::setFunctionCode(codice FunctionCode di QModbusPdu).

Imposta il codice funzione della risposta su c.

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