1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 <2023> 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 <2023> 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Network reconnection issue using modbus over asyn |
From: | Paul Richardson - STFC UKRI via Tech-talk <tech-talk at aps.anl.gov> |
To: | Mark Rivers <rivers at cars.uchicago.edu> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Fri, 17 Nov 2023 13:58:53 +0000 |
Hi Mark, Yes, this issue is caused by disconnecting the network cable at the PLC end, so the connection is not closed cleanly. Asyn.CNCT reports Disconnect, just once, the moment the cable is removed. If I leave it disconnected for roughly up to a minute, the connection is always re-established and asyn.CNCT reports Connect, just once, as expected.
The problem only seems to occur when I leave the cable disconnected for longer, usually 5 mins or more. Sometimes upon re-connection it works Ok, but more often than not on re-connection the asyn.CNCT
status repeatedly flips between Connect and Disconnect. Looking at the socket (using netstat -at) for the PLC port it reports CLOSE_WAIT, interspersed with ESTABLISHED. I’m currently using asyn4-38 and modbus-R2-4. One of the first things I tried was using more up to date versions, so I downloaded asyn-R4-43 and modbus-R2-11, but the problem still occurred. Regards Paul From: Mark Rivers <rivers at cars.uchicago.edu>
If I understand correctly this happens when you disconnect the cable. So the PLC has not cleanly closed the connection, correct?
Do you see the problem when you disconnect the cable for a shorter amount of time, say 15 seconds? What you should see is a single message for each asyn port that the connection is down, and then a single message when it is back up again. I will test early next week to verify that is what I see.
Sent from my iPhone
|