QModbusDeviceIdentification Class
QModbusDeviceIdentificationは、Modbusサーバの物理的および機能的な記述を表すコンテナ・クラスです。詳細...
ヘッダー | #include <QModbusDeviceIdentification> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS SerialBus) target_link_libraries(mytarget PRIVATE Qt6::SerialBus) |
qmake: | QT += serialbus |
パブリックな型
enum | ConformityLevel { BasicConformityLevel, RegularConformityLevel, ExtendedConformityLevel, BasicIndividualConformityLevel, RegularIndividualConformityLevel, ExtendedIndividualConformityLevel } |
enum | ObjectId { VendorNameObjectId, ProductCodeObjectId, MajorMinorRevisionObjectId, VendorUrlObjectId, ProductNameObjectId, …, UndefinedObjectId } |
enum | ReadDeviceIdCode { BasicReadDeviceIdCode, RegularReadDeviceIdCode, ExtendedReadDeviceIdCode, IndividualReadDeviceIdCode } |
パブリック関数
QModbusDeviceIdentification() | |
QModbusDeviceIdentification::ConformityLevel | conformityLevel() const |
bool | contains(uint objectId) const |
bool | insert(uint objectId, const QByteArray &value) |
bool | isValid() const |
QList<int> | objectIds() const |
void | remove(uint objectId) |
void | setConformityLevel(QModbusDeviceIdentification::ConformityLevel level) |
QByteArray | value(uint objectId) const |
静的パブリックメンバ
QModbusDeviceIdentification | fromByteArray(const QByteArray &ba) |
詳細説明
Device Identification インターフェースは、アドレス指定可能なデータ要素のセットで構成されるアドレス空間としてモデル化されます。データ要素はオブジェクトと呼ばれ、ObjectId がそれらを識別します。
メンバ型ドキュメント
enum QModbusDeviceIdentification::ConformityLevel
デバイスの識別適合レベルとサポートされるアクセスのタイプを定義する。
定数 | 値 | 説明 |
---|---|---|
QModbusDeviceIdentification::BasicConformityLevel | 0x01 | 基本識別(ストリーム・アクセス)。 |
QModbusDeviceIdentification::RegularConformityLevel | 0x02 | 通常の識別(ストリーム・アクセス)。 |
QModbusDeviceIdentification::ExtendedConformityLevel | 0x03 | 拡張識別(ストリームアクセス)。 |
QModbusDeviceIdentification::BasicIndividualConformityLevel | 0x81 | 基本識別(ストリームアクセスと個別アクセス)。 |
QModbusDeviceIdentification::RegularIndividualConformityLevel | 0x82 | 通常識別(ストリーム・アクセスおよび個人アクセス)。 |
QModbusDeviceIdentification::ExtendedIndividualConformityLevel | 0x83 | 拡張識別(ストリームアクセスと個別アクセス)。 |
ReadDeviceIdCodeも参照のこと 。
enum QModbusDeviceIdentification::ObjectId
この列挙型は、使用可能なサーバーオブジェクトを記述する。このインタフェースは3つのオブジェクトのカテゴリから構成される:
基本デバイス識別。このカテゴリのオブジェクトはすべて必須である。
定数 | 値 | 説明 |
---|---|---|
QModbusDeviceIdentification::VendorNameObjectId | 0x00 | デバイスのベンダー名。 |
QModbusDeviceIdentification::ProductCodeObjectId | 0x01 | デバイスの製品コード。 |
QModbusDeviceIdentification::MajorMinorRevisionObjectId | 0x02 | 製品バージョン番号。 |
通常のデバイス識別。このカテゴリのオブジェクトはすべて標準定義で、オプションです。
定数 | 値 | 説明 |
---|---|---|
QModbusDeviceIdentification::VendorUrlObjectId | 0x03 | デバイスのベンダー URL。 |
QModbusDeviceIdentification::ProductNameObjectId | 0x04 | デバイスの製品名。 |
QModbusDeviceIdentification::ModelNameObjectId | 0x05 | デバイスのモデル名。 |
QModbusDeviceIdentification::UserApplicationNameObjectId | 0x06 | デバイスのユーザー・アプリケーション名。 |
予約範囲 (ReservedObjectId >= ObjectId < ProductDependentObjectId)。使用しないでください。
定数 | 値 | 説明 |
---|---|---|
QModbusDeviceIdentification::ReservedObjectId | 0x07 | 予約オブジェクト ID の最初の値。 |
拡張デバイス識別。これらのデータはすべてデバイスに依存し、オプションです。
定数 | 値 | 説明 |
---|---|---|
QModbusDeviceIdentification::ProductDependentObjectId | 0x80 | 製品依存識別子の最初に取り得る値。 |
QModbusDeviceIdentification::UndefinedObjectId | 0x100 | 使用しないでください。 |
enum QModbusDeviceIdentification::ReadDeviceIdCode
読み取り識別要求のアクセスタイプを定義します。
ストリームアクセス:
定数 | 値 | 説明 |
---|---|---|
QModbusDeviceIdentification::BasicReadDeviceIdCode | 0x01 | 基本デバイス識別の取得要求。 |
QModbusDeviceIdentification::RegularReadDeviceIdCode | 0x02 | 通常デバイス識別の取得要求。 |
QModbusDeviceIdentification::ExtendedReadDeviceIdCode | 0x03 | 拡張デバイス識別の取得要求。 |
個別アクセス:
定数 | 値 | 説明 |
---|---|---|
QModbusDeviceIdentification::IndividualReadDeviceIdCode | 0x04 | 特定の識別オブジェクトの取得要求。 |
メンバー関数ドキュメント
[constexpr noexcept]
QModbusDeviceIdentification::QModbusDeviceIdentification()
無効な QModbusDeviceIdentification オブジェクトを構築します。
QModbusDeviceIdentification::ConformityLevel QModbusDeviceIdentification::conformityLevel() const
デバイスの識別適合レベルとサポートされているアクセスのタイプを返す。
setConformityLevel()も参照 。
bool QModbusDeviceIdentification::contains(uint objectId) const
与えられたobjectId に該当する項目があればtrue
を返し、なければfalse
を返します。
ObjectIdも参照 。
[static]
QModbusDeviceIdentification QModbusDeviceIdentification::fromByteArray(const QByteArray &ba)
バイト配列ba をQModbusDeviceIdentification オブジェクトに変換します。
注意: :バイト配列の処理中に何らかのエラーが発生した場合、返されるオブジェクトは空であったり、無効であったりする可能性があります。
isValid()も参照 。
bool QModbusDeviceIdentification::insert(uint objectId, const QByteArray &value)
objectId 、値がvalue の新しい項目を挿入する。すでにobjectId の項目がある場合、その項目の値はvalue に置き換えられる。
value のサイズが 245 バイト未満で、objectId のサイズがQModbusDeviceIdentification::UndefinedObjectId 未満の場合、true
を返す。
ObjectIdも参照のこと 。
bool QModbusDeviceIdentification::isValid() const
機器識別オブジェクトが有効であればtrue
を返し、そうでなければfalse
を返す。
ProductNameObjectId 、ProductCodeObjectId 、MajorMinorRevisionObjectId が空でない値に設定されていれば、機器識別オブジェクトは有効であるとみなされる。このオブジェクトは、有効なオブジェクト ID と関連データを含むことができます。
注意: デフォルトで構築された機器識別オブジェクトは無効です。
QList<int> QModbusDeviceIdentification::objectIds() const
QModbusDeviceIdentification
オブジェクトに含まれるすべてのオブジェクト ID を昇順に含むリストを返します。
ObjectIdも参照してください 。
void QModbusDeviceIdentification::remove(uint objectId)
与えられたobjectId の項目を削除します。
ObjectIdも参照してください 。
void QModbusDeviceIdentification::setConformityLevel(QModbusDeviceIdentification::ConformityLevel level)
デバイスの識別適合レベルと、サポートされるアクセスのタイプをlevel に設定する。
conformityLevel()も参照のこと 。
QByteArray QModbusDeviceIdentification::value(uint objectId) const
objectId objectId を持つ項目がない場合、この関数はデフォルトで構成された値を返します。
ObjectIdも参照してください 。
© 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.