PySide6.QtSerialBus.QModbusTcpServer¶
- class QModbusTcpServer¶
- The - QModbusTcpServerclass 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 - QModbusTcpServerwith the specified- parent. The- serverAddresspreset is- 255.- installConnectionObserver(observer)¶
- Parameters:
- observer – - QModbusTcpConnectionObserver
 
 - Installs an - observerthat can be used to obtain notifications when a new TCP client connects to this server instance. In addition, the- observercan be used to reject the incoming TCP connection.- QModbusTcpServertakes ownership of the given- observer. Any previously set observer will be deleted. The observer can be uninstalled by calling this function with- nullptras parameter.- See also - modbusClientDisconnected(modbusClient)¶
- Parameters:
- modbusClient – - QTcpSocket
 
 - This signal is emitted when a current TCP based - modbusClientdisconnects 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 - QModbusTcpConnectionObservervia- installConnectionObserver().- See also