QModbusRtuSerialSlave Class▲
-
Header: QModbusRtuSerialSlave
-
Since: Qt 5.8
-
qmake: QT += serialbus
-
Inherits: QModbusServer
Detailed Description▲
Communication via Modbus requires the interaction between a single Modbus client instance and multiple Modbus server. This class provides the Modbus server implementation via a serial port.
Since multiple Modbus server instances can interact with a Modbus client at the same time (using a serial bus), servers are identified by their serverAddress().
Member Function Documentation▲
[explicit] QModbusRtuSerialSlave::QModbusRtuSerialSlave(QObject *parent = nullptr)▲
Constructs a QModbusRtuSerialSlave with the specified parent. The serverAddress preset is 1.
[virtual] QModbusRtuSerialSlave::~QModbusRtuSerialSlave()▲
Destroys the QModbusRtuSerialSlave instance.
[override virtual protected] void QModbusRtuSerialSlave::close()▲
Reimplements: QModbusDevice::close().
[override virtual protected] bool QModbusRtuSerialSlave::open()▲
Reimplements: QModbusDevice::open().
When calling this function, existing buffered data is removed from the serial port.
[override virtual protected] QModbusResponse QModbusRtuSerialSlave::processRequest(const QModbusPdu &request)▲
Reimplements: QModbusServer::processRequest(const QModbusPdu &request).
Processes the Modbus client request specified by request and returns a Modbus response.
The Modbus function QModbusRequest::EncapsulatedInterfaceTransport with MEI Type 13 (0x0D) CANopen General Reference is filtered out because it is usually Modbus TCP or Modbus serial ASCII only.
A request to the RTU serial slave will be answered with a Modbus exception response with the exception code QModbusExceptionResponse::IllegalFunction.
[override virtual] bool QModbusRtuSerialSlave::processesBroadcast() const▲
Reimplements: QModbusServer::processesBroadcast() const.