Repository navigation
How to deal with lost connection? #445
|
I cannot find any way to catch connection loss (remote disconnection or cable disconnection, etc). |
Replies: 2 comments
|
The is_open property just tells you a connection to the local router is open or not, not the PLC, the only way to tell if a connection is lost is by trying to read a variable. I normally set up a "heartbeat" to read a variable on a set time basis. When you say the C library does it, what function is this? It may be able to be added. |
|
I had right a closer look to the code I wrote in c++ much time ago linking the same c library. And I apologize, I misremembered! My implementation upon the library did it, but without support of the library because it is maybe UDP communication. Having also a closer look in the library the assertion ("communication closed by remote") is reported simply when closing connection and no reply response is received.
So, again, sorry for my request, and hope at least that these thread could help others to implement such important feature. |
I had right a closer look to the code I wrote in c++ much time ago linking the same c library. And I apologize, I misremembered! My implementation upon the library did it, but without support of the library because it is maybe UDP communication. Having also a closer look in the library the assertion ("communication closed by remote") is reported simply when closing connection and no reply response is received.
What I used for? 2 mechanism: