QModbusDeviceIdentification Class

QModbusDeviceIdentification은 모드버스 서버의 물리적 및 기능적 설명을 나타내는 컨테이너 클래스입니다. 더 보기...

헤더: #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)

상세 설명

장치 식별 인터페이스는 주소 지정 가능한 데이터 요소 집합으로 구성된 주소 공간으로 모델링됩니다. 데이터 요소를 객체라고 하며 ObjectId 는 객체를 식별합니다.

멤버 유형 문서

enum QModbusDeviceIdentification::ConformityLevel

디바이스의 식별 적합성 수준과 지원되는 액세스 유형을 정의합니다.

상수설명
QModbusDeviceIdentification::BasicConformityLevel0x01기본 식별(스트림 액세스).
QModbusDeviceIdentification::RegularConformityLevel0x02일반 식별(스트림 액세스).
QModbusDeviceIdentification::ExtendedConformityLevel0x03확장 식별(스트림 액세스).
QModbusDeviceIdentification::BasicIndividualConformityLevel0x81기본 식별(스트림 액세스 및 개별 액세스).
QModbusDeviceIdentification::RegularIndividualConformityLevel0x82일반 식별(스트림 액세스 및 개별 액세스).
QModbusDeviceIdentification::ExtendedIndividualConformityLevel0x83확장 식별(스트림 액세스 및 개별 액세스).

ReadDeviceIdCode도 참조하세요 .

enum QModbusDeviceIdentification::ObjectId

이 열거형은 가능한 서버 객체를 설명합니다. 인터페이스는 세 가지 범주의 객체로 구성됩니다:

기본 장치 식별. 이 카테고리의 모든 객체는 필수입니다.

Constant설명
QModbusDeviceIdentification::VendorNameObjectId0x00장치의 공급업체 이름입니다.
QModbusDeviceIdentification::ProductCodeObjectId0x01장치의 제품 코드입니다.
QModbusDeviceIdentification::MajorMinorRevisionObjectId0x02제품 버전 번호입니다.

일반 장치 식별. 이 카테고리의 모든 객체는 표준으로 정의되며 선택 사항입니다.

상수설명
QModbusDeviceIdentification::VendorUrlObjectId0x03장치의 공급업체 URL입니다.
QModbusDeviceIdentification::ProductNameObjectId0x04장치의 제품 이름입니다.
QModbusDeviceIdentification::ModelNameObjectId0x05장치의 모델명입니다.
QModbusDeviceIdentification::UserApplicationNameObjectId0x06장치의 사용자 애플리케이션 이름입니다.

예약된 범위(예: ReservedObjectId >= ObjectId < ProductDependentObjectId). 사용하지 마십시오.

상수설명
QModbusDeviceIdentification::ReservedObjectId0x07예약된 개체 ID의 첫 번째 값입니다.

확장 장치 식별. 이 모든 데이터는 장치에 따라 다르며 선택 사항입니다.

상수설명
QModbusDeviceIdentification::ProductDependentObjectId0x80제품 종속 식별자의 첫 번째 가능한 값입니다.
QModbusDeviceIdentification::UndefinedObjectId0x100사용하지 마십시오.

enum QModbusDeviceIdentification::ReadDeviceIdCode

읽기 식별 요청의 액세스 유형을 정의합니다.

스트림 액세스:

상수설명
QModbusDeviceIdentification::BasicReadDeviceIdCode0x01기본 장치 식별을 가져오기 위한 요청입니다.
QModbusDeviceIdentification::RegularReadDeviceIdCode0x02일반 디바이스 식별을 가져오기 위한 요청입니다.
QModbusDeviceIdentification::ExtendedReadDeviceIdCode0x03확장 장치 식별을 가져오기 위한 요청입니다.

개별 액세스:

상수설명
QModbusDeviceIdentification::IndividualReadDeviceIdCode0x04특정 식별 객체 하나를 가져오기 위한 요청입니다.

멤버 함수 문서

[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)

바이트 배열 baQModbusDeviceIdentification 객체로 변환합니다.

참고: : 바이트 배열을 처리하는 동안 오류가 발생하면 반환된 객체가 비어 있거나 유효하지 않을 수 있습니다.

isValid()도 참조하세요 .

bool QModbusDeviceIdentification::insert(uint objectId, const QByteArray &value)

objectIdvalue 값을 가진 새 항목을 삽입합니다. 이미 objectId 값을 가진 항목이 있는 경우 해당 항목의 값은 value 로 바뀝니다.

value 의 크기가 245 바이트보다 작고 objectIdQModbusDeviceIdentification::UndefinedObjectId 보다 작으면 true 을 반환합니다.

ObjectId참조하십시오 .

bool QModbusDeviceIdentification::isValid() const

디바이스 식별 객체가 유효하면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

ProductNameObjectId, ProductCodeObjectIdMajorMinorRevisionObjectId 가 비어 있지 않은 값으로 설정된 경우 장치 식별 객체는 유효한 것으로 간주됩니다. 그래도 객체에는 유효한 객체 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.