Modbus TCP - Dropped connection - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2) +--- Thread: Modbus TCP - Dropped connection (/showthread.php?tid=4354) |
Modbus TCP - Dropped connection - sx3 - 06.11.2022 Hello, I have recently noticed that my LM/HomeLynk is dropping the TCP connection to a slave and does not reconnect to it. I have to manually reboot the slave to get the connection back. I can't say for 100% it's LM fault, but I have noticed a pattern during this weekend. When I'm at the LM config page and especially looking at the RS485 Mapping, the TCP connection dropped after a while when working. However when I quit working the TCP connection stays up all night long, hence thinking the problem is not with the slave, but with LM. That somehow looking at a mapping will disrupt the the TCP connection? The slave have been connected since mid August and I haven't noticed any dropped connections earlier. RE: Modbus TCP - Dropped connection - Daniel - 07.11.2022 Try enabling Persistent connection. RE: Modbus TCP - Dropped connection - sx3 - 07.11.2022 Persistent connection have been enabled but since the connection started to drop I tried eloborating with it disabled. Haven't noticed any difference. RE: Modbus TCP - Dropped connection - Daniel - 07.11.2022 How many registers do you read and what is the poll interval and the timeout? RE: Modbus TCP - Dropped connection - admin - 07.11.2022 Changing mapping causes a reload so connections are closed and open again. Unfortunately many Modbus TCP devices have problems with multiple TCP connections. If you're not doing any changes to the mapping then it cannot affect TCP connections. RE: Modbus TCP - Dropped connection - sx3 - 07.11.2022 I'll have to get back later tonight with # registers, interval and timeout. But a good guess is 50 registers, 5 second interval and default timeout for both of the Modbus slaves. I don't really change mapping I think, I have the mapper popup displayed, and click some of the registers to check "write to bus" maybe 4-5 registers in one sweep so maybe 10-30 seconds of editing in that sweep. Mostly this happened when I had the RS485 mapping up, then the TCP lost connection. RE: Modbus TCP - Dropped connection - admin - 07.11.2022 First RS485 port and TCP are handled by the same daemon so changing RS485 mapping settings will cause new TCP connections to be established. Some TCP devices cannot detect a closed connection quickly enough and since they can only handle several open connections at once such problems arise. RE: Modbus TCP - Dropped connection - sx3 - 07.11.2022 Alright, so when this occours I have to reboot the slave? No way of re-establish the connection through LM? Can the LM close the connection in a manner that a slave understands it's closed, before LM reloading the connection? Or is this what it is? RE: Modbus TCP - Dropped connection - Daniel - 07.11.2022 The persistent mode should be the solution to this. It then keeps the connection permanently open without closing it. RE: Modbus TCP - Dropped connection - sx3 - 22.11.2022 Late reply, but I have persistant mode on and it do drop the connection anyway. But Daniel and Admin doesn't seem to agree if connection should be dropped or not. Perhaps it should keep connection, but somehow doesn't? RE: Modbus TCP - Dropped connection - admin - 23.11.2022 When persistent mode is enabled the connection is kept open unless you change something in the mapping (including RTU 1). After any mapping changes all persistent TCP connections are closed and new connections are created. |