QModbusRtuSerialClient Class
QModbusRtuSerialClient クラスは、Modbus サーバーとの通信にシリアルバスを使用する Modbus クライアントを表します。詳細...
| ヘッダー: | #include <QModbusRtuSerialClient> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS SerialBus) target_link_libraries(mytarget PRIVATE Qt6::SerialBus) |
| qmake: | QT += serialbus |
| 以下より: | Qt 6.2 |
| 継承元: | QModbusClient |
パブリック関数
| QModbusRtuSerialClient(QObject *parent = nullptr) | |
| int | interFrameDelay() const |
| void | setInterFrameDelay(int microseconds) |
| void | setTurnaroundDelay(int turnaroundDelay) |
| int | turnaroundDelay() const |
再実装されたプロテクト関数
詳細な説明
Modbus による通信には、単一の Modbus クライアントインスタンスと複数の Modbus サーバーとの間のやり取りが必要です。このクラスは、シリアルポートを介したクライアントの実装を提供します。
メンバ関数のドキュメント
[explicit] QModbusRtuSerialClient::QModbusRtuSerialClient(QObject *parent = nullptr)
指定されたparent を使用して、シリアルModbusクライアントを構築します。
[override virtual protected] void QModbusRtuSerialClient::close()
QModbusDevice::close() を再実装します。
int QModbusRtuSerialClient::interFrameDelay() const
2つの連続するModbusメッセージ間の無通信間隔の時間をマイクロ秒単位で返します。
setInterFrameDelay()も参照してください 。
[override virtual protected] bool QModbusRtuSerialClient::open()
QModbusDevice::open() を再実装しています。
注: この関数を呼び出すと 、シリアルポートから既存のバッファデータが削除されます。
void QModbusRtuSerialClient::setInterFrameDelay(int microseconds)
2つの連続するModbusメッセージ間の無通信間隔におけるmicroseconds の量を設定します。デフォルトでは、クラス実装はModbus仕様に基づいて事前に計算された値を使用します。アクティブな接続または実行中の接続は、このような遅延の変更の影響を受けません。
注: microseconds が-1に設定されている場合 、またはmicroseconds が事前に計算された遅延値よりも小さい場合、この事前に計算された値がフレーム遅延として使用されます。
「interFrameDelay()」も参照してください 。
void QModbusRtuSerialClient::setTurnaroundDelay(int turnaroundDelay)
Modbusブロードキャストとそれに続くModbusメッセージの間の無通信間隔を、turnaroundDelay に設定します。通常、このターンアラウンド遅延は100 ~200 ミリ秒の範囲にあります。
turnaroundDelay()も参照してください 。
int QModbusRtuSerialClient::turnaroundDelay() const
Modbusブロードキャストとそれに続くModbusメッセージの間の無通信間隔をミリ秒単位で返します。デフォルト値は100 ミリ秒に設定されています。
setTurnaroundDelay()も参照してください 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.