QModbusDataUnit Class
QModbusDataUnit is a container class representing single bit and 16
bit word entries in the Modbus register. More...
Header: | #include <QModbusDataUnit> |
qmake: | QT += serialbus |
Since: | Qt 5.8 |
This class was introduced in Qt 5.8.
Public Types
enum | RegisterType { Invalid, DiscreteInputs, Coils, InputRegisters, HoldingRegisters } |
Related Non-Members
typedef | QModbusDataUnitMap |
Detailed Description
QModbusDataUnit can be used for read and write operations. The entries are addressed via startAddress() and the valueCount() number of contiguous entries. registerType() determines which register is used for the operations. Note that some registers are read-only registers.
The actual values() are either single bit or 16
bit based. QModbusDataUnit::DiscreteInputs and QModbusDataUnit::Coils only accept single bits. Therefore 0
is interpreted as 0
and anything else 1
.
Member Type Documentation
enum QModbusDataUnit::RegisterType
This enum describes all supported register types.
Constant | Value | Description |
---|---|---|
QModbusDataUnit::Invalid | 0 | Set by the default constructor, do not use. |
QModbusDataUnit::DiscreteInputs | 1 | This type of data can be provided by an I/O system. |
QModbusDataUnit::Coils | 2 | This type of data can be alterable by an application program. |
QModbusDataUnit::InputRegisters | 3 | This type of data can be provided by an I/O system. |
QModbusDataUnit::HoldingRegisters | 4 | This type of data can be alterable by an application program. |
Related Non-Members
typedef QModbusDataUnit::QModbusDataUnitMap
Synonym for QMap<QModbusDataUnit::RegisterType, QModbusDataUnit>.
This typedef was introduced in Qt 5.8.