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

再実装された保護された関数

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

詳細説明

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()も参照してください

© 2025 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.