Auf dieser Seite

QModbusExceptionResponse Class

„QModbusExceptionResponse“ ist eine Containerklasse, die die Funktion und den Fehlercode innerhalb einer Modbus-ADU enthält. Mehr dazu...

Header: #include <QModbusExceptionResponse>
CMake: find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
qmake: QT += serialbus
Erbt von: QModbusResponse

Öffentliche Funktionen

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

Neu implementierte öffentliche Funktionen

virtual void setFunctionCode(QModbusPdu::FunctionCode c) override

Detaillierte Beschreibung

Eine typische QModbusExceptionResponse-Antwort kann wie folgt aussehen:

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

Dokumentation der Mitgliedsfunktionen

[constexpr noexcept default] QModbusExceptionResponse::QModbusExceptionResponse()

Erzeugt eine ungültige „QModbusExceptionResponse“.

QModbusExceptionResponse::QModbusExceptionResponse(const QModbusPdu &pdu)

Erstellt eine Kopie von „ pdu “.

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

Erstellt ein `QModbusExceptionResponse`-Objekt, bei dem der Funktionscode auf ` code ` und der Ausnahmecode auf ` ec` gesetzt ist.

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

Setzt den Ausnahmecode der Antwort auf „ ec “.

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

Implementiert neu: QModbusPdu::setFunctionCode(QModbusPdu::FunctionCode code).

Setzt den Funktionscode der Antwort auf „ 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.