QModbusExceptionResponse Class

QModbusExceptionResponse is a container class containing the function and error code inside a 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

详细描述

A typical QModbusExceptionResponse response can looks like this:

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

成员函数文档编制

[constexpr noexcept] QModbusExceptionResponse:: QModbusExceptionResponse ()

Constructs an invalid QModbusExceptionResponse.

QModbusExceptionResponse:: QModbusExceptionResponse (const QModbusPdu & pdu )

构造副本为 pdu .

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

Constructs a QModbusExceptionResponse with function code set to code and exception error code set to ec .

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

Sets the response's exception code to ec .

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

重实现: QModbusPdu::setFunctionCode (QModbusPdu::FunctionCode code).

Sets the response's function code to c .