QModbusClient Class
The QModbusClient class is the interface to send Modbus requests. More...
| Header: | #include <QModbusClient> |
| qmake: | QT += serialbus |
| Since: | Qt 5.8 |
| Inherits: | QModbusDevice |
| Inherited By: |
This class was introduced in Qt 5.8.
Properties
- timeout : int
Public Functions
| void | setTimeout(int newTimeout) |
| int | timeout() const |
Signals
| void | timeoutChanged(int newTimeout) |
Detailed Description
The QModbusClient API is constructed around one QModbusClient object, which holds the common configuration and settings for the requests it sends. One QModbusClient should be enough for the whole Qt application.
Once a QModbusClient object has been created, the application can use it to send requests. The returned object is used to obtain any data returned in response to the corresponding request.
QModbusClient has an asynchronous API. When the finished slot is called, the parameter it takes is the QModbusReply object containing the PDU as well as meta-data (Addressing, etc.).
Note: QModbusClient queues the requests it receives. The number of requests executed in parallel is dependent on the protocol. For example, the HTTP protocol on desktop platforms issues 6 requests in parallel for one host/port combination.
Property Documentation
timeout : int
This property holds the timeout value used by this client
Returns the timeout value used by this QModbusClient instance in ms. A timeout is indicated by a TimeoutError. The default value is 1000 ms.
Access functions:
| int | timeout() const |
| void | setTimeout(int newTimeout) |
Notifier signal:
| void | timeoutChanged(int newTimeout) |
See also setTimeout.