QModbusDeviceIdentification#
The QModbusDeviceIdentification
is a container class representing the physical and functional description of a Modbus server. More…
Synopsis#
Functions#
def
conformityLevel
()def
contains
(objectId)def
insert
(objectId, data)def
isValid
()def
objectIds
()def
remove
(objectId)def
setConformityLevel
(level)def
value
(objectId)
Static functions#
def
fromByteArray
(ba)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
The Device Identification interface is modeled as an address space composed of a set of addressable data elements. The data elements are called objects and an ObjectId
identifies them.
- class PySide6.QtSerialBus.QModbusDeviceIdentification#
Constructs an invalid QModbusDeviceIdentification
object.
- PySide6.QtSerialBus.QModbusDeviceIdentification.ObjectId#
This enum describes the possible server objects. The interface consists of three categories of objects:
Basic Device Identification. All objects of this category are mandatory.
Constant
Description
QModbusDeviceIdentification.VendorNameObjectId
The vendor name of the device.
QModbusDeviceIdentification.ProductCodeObjectId
The product code of the device.
QModbusDeviceIdentification.MajorMinorRevisionObjectId
The product version numbering.
Regular Device Identification. All objects of this category are standard defined and optional.
Constant
Description
QModbusDeviceIdentification.VendorUrlObjectId
The vendor URL of the device.
QModbusDeviceIdentification.ProductNameObjectId
The product name of the device.
QModbusDeviceIdentification.ModelNameObjectId
The model name of the device.
QModbusDeviceIdentification.UserApplicationNameObjectId
The user application name of the device.
Reserved range (i.e., ReservedObjectId >= ObjectId < ProductDependentObjectId). Do not use.
Constant
Description
QModbusDeviceIdentification.ReservedObjectId
First value of reserved object Ids.
Extended Device Identification. All of these data are device dependent and optional.
Constant
Description
QModbusDeviceIdentification.ProductDependentObjectId
First possible value of product dependent identifiers.
QModbusDeviceIdentification.UndefinedObjectId
Do not use.
- PySide6.QtSerialBus.QModbusDeviceIdentification.ReadDeviceIdCode#
Defines the access type of the read identification request.
Stream access:
Constant
Description
QModbusDeviceIdentification.BasicReadDeviceIdCode
Request to get the basic device identification.
QModbusDeviceIdentification.RegularReadDeviceIdCode
Request to get the regular device identification.
QModbusDeviceIdentification.ExtendedReadDeviceIdCode
Request to get the extended device identification.
Individual access:
Constant
Description
QModbusDeviceIdentification.IndividualReadDeviceIdCode
Request to get one specific identification object.
- PySide6.QtSerialBus.QModbusDeviceIdentification.ConformityLevel#
Defines the identification conformity level of the device and type of supported access.
Constant
Description
QModbusDeviceIdentification.BasicConformityLevel
Basic identification (stream access).
QModbusDeviceIdentification.RegularConformityLevel
Regular identification (stream access).
QModbusDeviceIdentification.ExtendedConformityLevel
Extended identification (stream access).
QModbusDeviceIdentification.BasicIndividualConformityLevel
Basic identification (stream access and individual access).
QModbusDeviceIdentification.RegularIndividualConformityLevel
Regular identification (stream access and individual access).
QModbusDeviceIdentification.ExtendedIndividualConformityLevel
Extended identification (stream access and individual access).
See also
ReadDeviceIdCode
- PySide6.QtSerialBus.QModbusDeviceIdentification.conformityLevel()#
- Return type:
Returns the identification conformity level of the device and type of supported access.
See also
- PySide6.QtSerialBus.QModbusDeviceIdentification.contains(objectId)#
- Parameters:
objectId – int
- Return type:
bool
Returns true
if there is an item for the given objectId
; otherwise false
.
See also
ObjectId
- static PySide6.QtSerialBus.QModbusDeviceIdentification.fromByteArray(ba)#
- Parameters:
- Return type:
Converts the byte array ba
to a QModbusDeviceIdentification
object.
Note
: The returned object might be empty or even invalid if some error occurs while processing the byte array.
See also
- PySide6.QtSerialBus.QModbusDeviceIdentification.insert(objectId, data)#
- Parameters:
objectId – int
data –
PySide6.QtCore.QByteArray
- Return type:
bool
Inserts a new item with the objectId
and a value of value
. If there is already an item with the objectId
, that item’s value is replaced with value
.
Returns true
if the size of value
is less than 245 bytes and the objectId
is less then UndefinedObjectId
.
See also
ObjectId
- PySide6.QtSerialBus.QModbusDeviceIdentification.isValid()#
- Return type:
bool
Returns true
if the device identification object is valid; otherwise false
.
A device identification object is considered valid if ProductNameObjectId
, ProductCodeObjectId
and MajorMinorRevisionObjectId
are set to a non-empty value. Still the object can contain valid object id’s and associated data.
Note
A default constructed device identification object is invalid.
- PySide6.QtSerialBus.QModbusDeviceIdentification.objectIds()#
- Return type:
.list of int
Returns a list containing all the object id’s in the QModbusDeviceIdentification
object in ascending order.
See also
ObjectId
- PySide6.QtSerialBus.QModbusDeviceIdentification.remove(objectId)#
- Parameters:
objectId – int
Removes the item for the given objectId
.
See also
ObjectId
- PySide6.QtSerialBus.QModbusDeviceIdentification.setConformityLevel(level)#
- Parameters:
level –
ConformityLevel
Sets the identification conformity level of the device and type of supported access to level
.
See also
- PySide6.QtSerialBus.QModbusDeviceIdentification.value(objectId)#
- Parameters:
objectId – int
- Return type:
Returns the value associated with the objectId
. If there is no item with the objectId
, the function returns a default-constructed value.
See also
ObjectId