QModbusExceptionResponse Class | Qt Serial Bus 5.6

Qt Documentation (Technology Preview) | Qt Serial Bus | C++ Classes | QModbusExceptionResponse

Qt 5.6.2 Reference Documentation

# 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.6
Inherits: | QModbusResponse

- List of all members, including inherited members

## Public Functions

| QModbusExceptionResponse() = default
| QModbusExceptionResponse(const QModbusPdu &pdu)
| QModbusExceptionResponse(FunctionCode code, ExceptionCode ec)
void | setExceptionCode(ExceptionCode ec)

## Reimplemented Public Functions

virtual void | setFunctionCode(FunctionCode c)

- 11 public functions inherited from QModbusPdu

### Additional Inherited Members

- 2 static public members inherited from QModbusResponse
- 1 static public member inherited from QModbusPdu
- 1 protected function inherited from QModbusPdu

## 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

### `[default]` QModbusExceptionResponse::QModbusExceptionResponse()

Constructs an invalid QModbusExceptionResponse.

### QModbusExceptionResponse::QModbusExceptionResponse(const QModbusPdu &pdu)

Constructs a copy of pdu.

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

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

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

Sets the response's exception code to ec.

### `[virtual]` void QModbusExceptionResponse::setFunctionCode(FunctionCode c)

Reimplemented from QModbusPdu::setFunctionCode().

Sets the response's function code to c.