このページでは

QModbusExceptionResponse Class

QModbusExceptionResponse は、Modbus ADU 内に関数とエラーコードを格納するコンテナクラスです。詳細...

ヘッダー: #include <QModbusExceptionResponse>
CMake: find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
qmake: QT += serialbus
継承元: QModbusResponse

パブリック関数

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

再実装されたパブリック関数

virtual void setFunctionCode(QModbusPdu::FunctionCode c) override

詳細な説明

典型的な QModbusExceptionResponse のレスポンスは、次のような形式になります:

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

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

[constexpr noexcept default] QModbusExceptionResponse::QModbusExceptionResponse()

無効な QModbusExceptionResponse を生成します。

QModbusExceptionResponse::QModbusExceptionResponse(const QModbusPdu &pdu)

pdu のコピーを作成します。

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

関数コードをcode 、例外エラーコードをec に設定したQModbusExceptionResponseを生成します。

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

レスポンスの例外コードをec に設定します。

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

QModbusPdu::setFunctionCode (QModbusPdu::FunctionCode code)を再実装します。

応答のファンクションコードを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.