The QModbusTcpServer class represents a Modbus server that uses a TCP server for its communication with the Modbus client. More...
| Header: | #include <QModbusTcpServer> |
| qmake: | QT += serialbus |
| Since: | Qt 5.8 |
| Inherits: | QModbusServer |
| QModbusTcpServer(QObject *parent = nullptr) | |
| virtual | ~QModbusTcpServer() |
| virtual void | close() override |
| virtual bool | open() override |
| virtual QModbusResponse | processRequest(const QModbusPdu &request) override |
The QModbusTcpServer class represents a Modbus server that uses a TCP server for its communication with the Modbus client.
Communication via Modbus requires the interaction between a single Modbus client instance and single Modbus server. This class provides the Modbus server implementation via a TCP server.
Modbus TCP networks can have multiple servers. Servers are read/written by a client device represented by QModbusTcpClient.
Constructs a QModbusTcpServer with the specified parent. The serverAddress preset is 255.
[virtual] QModbusTcpServer::~QModbusTcpServer()Destroys the QModbusTcpServer instance.
[override virtual protected] void QModbusTcpServer::close()Reimplemented from QModbusDevice::close().
[override virtual protected] bool QModbusTcpServer::open()Reimplemented from QModbusDevice::open().
[override virtual protected] QModbusResponse
QModbusTcpServer::processRequest(const QModbusPdu &request)Reimplemented from QModbusServer::processRequest().
Processes the Modbus client request specified by request and returns a Modbus response.
The following Modbus function codes are filtered out as they are serial line only according to the Modbus Application Protocol Specification 1.1b:
A request to the TCP server will be answered with a Modbus exception response with the exception code QModbusExceptionResponse::IllegalFunction.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: