QModbusRtuSerialMaster Class

The QModbusRtuSerialMaster class represents a Modbus client that uses a serial bus for its communication with the Modbus server. 更多...

頭: #include <QModbusRtuSerialMaster>
qmake: QT += serialbus
Since: Qt 5.8
繼承: QModbusClient

該類在 Qt 5.8 引入。

公共函數

QModbusRtuSerialMaster (QObject * parent = nullptr)
int interFrameDelay () const
void setInterFrameDelay (int microseconds )
void setTurnaroundDelay (int turnaroundDelay )
int turnaroundDelay () const

重實現保護函數

virtual void close () override
virtual bool open () override

詳細描述

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.

成員函數文檔編製

QModbusRtuSerialMaster:: QModbusRtuSerialMaster ( QObject * parent = nullptr)

Constructs a serial Modbus master with the specified parent .

[override virtual protected] void QModbusRtuSerialMaster:: close ()

重實現: QModbusDevice::close ().

int QModbusRtuSerialMaster:: interFrameDelay () const

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

另請參閱 setInterFrameDelay ().

[override virtual protected] bool QModbusRtuSerialMaster:: open ()

重實現: QModbusDevice::open ().

注意: 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.

注意: microseconds 被設為 -1 或 microseconds is less than the pre-calculated delay then this pre-calculated value is used as frame delay.

另請參閱 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 毫秒。

該函數在 Qt 5.13 引入。

另請參閱 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 毫秒。

該函數在 Qt 5.13 引入。

另請參閱 setTurnaroundDelay ().