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::BasicConformityLevel | 0x01 | 기본 식별(스트림 액세스). |
QModbusDeviceIdentification::RegularConformityLevel | 0x02 | 일반 식별(스트림 액세스). |
QModbusDeviceIdentification::ExtendedConformityLevel | 0x03 | 확장 식별(스트림 액세스). |
QModbusDeviceIdentification::BasicIndividualConformityLevel | 0x81 | 기본 식별(스트림 액세스 및 개별 액세스). |
QModbusDeviceIdentification::RegularIndividualConformityLevel | 0x82 | 일반 식별(스트림 액세스 및 개별 액세스). |
QModbusDeviceIdentification::ExtendedIndividualConformityLevel | 0x83 | 확장 식별(스트림 액세스 및 개별 액세스). |
ReadDeviceIdCode도 참조하세요 .
enum QModbusDeviceIdentification::ObjectId
이 열거형은 가능한 서버 객체를 설명합니다. 인터페이스는 세 가지 범주의 객체로 구성됩니다:
기본 장치 식별. 이 카테고리의 모든 객체는 필수입니다.
Constant | 값 | 설명 |
---|---|---|
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.