Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

QModbusExceptionResponse Class

QModbusExceptionResponse is a container class containing the function and error code inside a Modbus ADU. More...

Header: #include <QModbusExceptionResponse>
qmake: QT += serialbus
Since: Qt 5.8
Inherits: QModbusResponse

Public Functions

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

Reimplemented Public Functions

virtual void setFunctionCode(QModbusPdu::FunctionCode c)

Additional Inherited Members

Detailed Description

QModbusExceptionResponse is a container class containing the function and error code inside a Modbus ADU.

A typical QModbusExceptionResponse response can looks like this:

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

Member Function Documentation

QModbusExceptionResponse::QModbusExceptionResponse()

Constructs an invalid QModbusExceptionResponse.

QModbusExceptionResponse::QModbusExceptionResponse(const QModbusPdu &pdu)

Constructs a copy of 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.

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

Reimplemented from QModbusPdu::setFunctionCode().

Sets the response's function code to c.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded