PySide6.QtSerialBus.QModbusTcpServer¶
- class QModbusTcpServer¶
The
QModbusTcpServer
class represents a Modbus server that uses a TCP server for its communication with the Modbus client. More…Synopsis¶
Methods¶
Signals¶
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¶
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 specifiedparent
. TheserverAddress
preset is255
.- installConnectionObserver(observer)¶
- Parameters:
observer –
QModbusTcpConnectionObserver
Installs an
observer
that can be used to obtain notifications when a new TCP client connects to this server instance. In addition, theobserver
can be used to reject the incoming TCP connection.QModbusTcpServer
takes ownership of the givenobserver
. Any previously set observer will be deleted. The observer can be uninstalled by calling this function withnullptr
as parameter.See also
- modbusClientDisconnected(modbusClient)¶
- Parameters:
modbusClient –
QTcpSocket
This signal is emitted when a current TCP based
modbusClient
disconnects from this Modbus TCP server. Note that there might be several TCP clients connected at the same time.Notifications on incoming new connections can be received by installing a
QModbusTcpConnectionObserver
viainstallConnectionObserver()
.See also