class QModbusRtuSerialClient

The QModbusRtuSerialClient class represents a Modbus client that uses a serial bus for its communication with the Modbus server. More

Inheritance diagram of PySide6.QtSerialBus.QModbusRtuSerialClient

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

Communication via Modbus requires the interaction between a single Modbus client instance and multiple Modbus servers. This class provides the client implementation via a serial port.

__init__([parent=None])
Parameters:

parentQObject

Constructs a serial Modbus client with the specified parent.

interFrameDelay()
Return type:

int

Returns the amount of microseconds for the silent interval between two consecutive Modbus messages.

setInterFrameDelay(microseconds)
Parameters:

microseconds – int

Sets the amount of microseconds for the silent interval between two consecutive Modbus messages. By default, the class implementation will use a pre-calculated value according to the Modbus specification. A active or running connection is not affected by such delay changes.

Note

If microseconds is set to -1 or microseconds is less than the pre-calculated delay then this pre-calculated value is used as frame delay.

setTurnaroundDelay(turnaroundDelay)
Parameters:

turnaroundDelay – int

Sets the amount of milliseconds for the silent interval between a Modbus broadcast and a consecutive Modbus messages to turnaroundDelay. Typically the turnaround delay is in the range of 100 to 200 milliseconds.

turnaroundDelay()
Return type:

int

Returns the amount of milliseconds for the silent interval between a Modbus broadcast and a consecutive Modbus messages. The default value is set to 100 milliseconds.