QModbusServer Class
The QModbusServer class is the interface to receive and process Modbus requests. More...
| Header: | #include <QModbusServer> |
| qmake: | QT += serialbus |
| Since: | Qt 5.8 |
| Inherits: | QModbusDevice |
| Inherited By: |
This class was introduced in Qt 5.8.
Public Types
| enum | Option { DiagnosticRegister, ExceptionStatusOffset, DeviceBusy, AsciiInputDelimiter, ListenOnlyMode, …, UserOption } |
Detailed Description
Modbus networks can have multiple Modbus servers. Modbus Servers are read/written by a Modbus client represented by QModbusClient. QModbusServer communicates with a Modbus backend, providing users with a convenient API.
Member Type Documentation
enum QModbusServer::Option
Each Modbus server has a set of values associated with it, each with its own option.
The general purpose options (and the associated types) are:
| Constant | Value | Description |
|---|---|---|
QModbusServer::DiagnosticRegister | 0 | The diagnostic register of the server. quint16 |
QModbusServer::ExceptionStatusOffset | 1 | The exception status byte offset of the server. quint16 |
QModbusServer::DeviceBusy | 2 | Flag to signal the server is engaged in processing a long-duration program command. quint16 |
QModbusServer::AsciiInputDelimiter | 3 | The Modbus ASCII end of message delimiter. char |
QModbusServer::ListenOnlyMode | 4 | Flag to set listen only mode of the server. This function is typically supported only by Modbus serial devices. bool |
QModbusServer::ServerIdentifier | 5 | The identifier of the server, not the server address. quint8 |
QModbusServer::RunIndicatorStatus | 6 | The run indicator of the server. quint8 |
QModbusServer::AdditionalData | 7 | The additional data of the server. QByteArray |
QModbusServer::DeviceIdentification | 8 | The physical and functional description of the server. QModbusDeviceIdentification |
User options:
| Constant | Value | Description |
|---|---|---|
QModbusServer::UserOption | 0x100 | The first option that can be used for user-specific purposes. |
For user options, it is up to the developer to decide which types to use and ensure that components use the correct types when accessing and setting values.