class QModbusExceptionResponse

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

Inheritance diagram of PySide6.QtSerialBus.QModbusExceptionResponse

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

A typical QModbusExceptionResponse response can looks like this:

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

Constructs an invalid QModbusExceptionResponse .

__init__(pdu)
Parameters:

pduQModbusPdu

Constructs a copy of pdu.

__init__(fc, ec)
Parameters:

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

setExceptionCode(ec)
Parameters:

ecExceptionCode

Sets the response’s exception code to ec.