QModbusRtuSerialMaster Class
The QModbusRtuSerialMaster class represents a Modbus client that uses a serial bus for its communication with the Modbus server. More...
| Header: | #include <QModbusRtuSerialMaster> |
| qmake: | QT += serialbus |
| Since: | Qt 5.8 |
| Inherits: | QModbusClient |
This class was introduced in Qt 5.8.
Public Functions
| QModbusRtuSerialMaster(QObject *parent = nullptr) | |
| int | interFrameDelay() const |
| void | setInterFrameDelay(int microseconds) |
| void | setTurnaroundDelay(int turnaroundDelay) |
| int | turnaroundDelay() const |
- 8 public functions inherited from QModbusClient
- 7 public functions inherited from QModbusDevice
- 30 public functions inherited from QObject
Reimplemented Protected Functions
- 2 protected functions inherited from QModbusClient
- 4 protected functions inherited from QModbusDevice
- 9 protected functions inherited from QObject
Related Non-Members
| typedef | QObjectList |
| QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
| T | qobject_cast(QObject *object) |
| T | qobject_cast(const QObject *object) |
Macros
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
| Q_CLASSINFO(Name, Value) | |
| Q_DISABLE_COPY(Class) | |
| Q_DISABLE_COPY_MOVE(Class) | |
| Q_DISABLE_MOVE(Class) | |
| Q_EMIT | |
| Q_ENUM(...) | |
| Q_ENUM_NS(...) | |
| Q_FLAG(...) | |
| Q_FLAG_NS(...) | |
| Q_GADGET | |
| Q_INTERFACES(...) | |
| Q_INVOKABLE | |
| Q_NAMESPACE | |
| Q_OBJECT | |
| Q_PROPERTY(...) | |
| Q_REVISION | |
| Q_SET_OBJECT_NAME(Object) | |
| Q_SIGNAL | |
| Q_SIGNALS | |
| Q_SLOT | |
| Q_SLOTS |
Additional Inherited Members
- 1 property inherited from QModbusClient
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 1 signal inherited from QModbusClient
- 2 signals inherited from QModbusDevice
- 2 signals inherited from QObject
- 9 static public members inherited from QObject
- 2 protected functions inherited from QModbusClient
- 4 protected functions inherited from QModbusDevice
- 9 protected functions inherited from QObject
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.
Member Function Documentation
QModbusRtuSerialMaster::QModbusRtuSerialMaster(QObject *parent = nullptr)
Constructs a serial Modbus master with the specified parent.
[override virtual protected] void QModbusRtuSerialMaster::close()
Reimplements: QModbusDevice::close().
int QModbusRtuSerialMaster::interFrameDelay() const
Returns the amount of microseconds for the silent interval between two consecutive Modbus messages.
See also setInterFrameDelay().
[override virtual protected] bool QModbusRtuSerialMaster::open()
Reimplements: QModbusDevice::open().
Note: When calling this function, existing buffered data is removed from the serial port.
void QModbusRtuSerialMaster::setInterFrameDelay(int microseconds)
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.
See also interFrameDelay().
void QModbusRtuSerialMaster::setTurnaroundDelay(int turnaroundDelay)
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.
This function was introduced in Qt 5.13.
See also turnaroundDelay().
int QModbusRtuSerialMaster::turnaroundDelay() const
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.
This function was introduced in Qt 5.13.
See also setTurnaroundDelay().