0
Not a bug

Interface losing connection after certain amount of time

ThomasDM 1 year ago in OPCUA4Unity updated by Support 1 year ago 3

When connecting the OPCUA_Interface with a PLC I lose connection with the PLC after a certain amount of time. One kicks me out after 2 min, another after 15 min (2 different connections).

The interface seems not to notice the disconnect because the value of isConnected in the interface stays on true but if I check the connected clients to the PLC the interface is gone (which was there on startup).

Reading a value after the disconnect on node level gives me the status value: Connection error

I import the nodes with the editor button but remove all nodes I dont need. And I dont continuously get new values on the nodes I keep. I can have the same values (no changes) for long periods of time.

Does the Interface only keeps the connection alive if the values continuously update or is something else going wrong?

Answer

Answer
Not a bug

Yes I understand but the used Library gives us no direct information about disconnection events. And I don't know exactly in your case who is closing the communication when nothing happens - is it the client or the server. I am closing this issue because for the moment we don't have a better solution.

GOOD, I'M SATISFIED
Satisfaction mark by ThomasDM 1 year ago
Under review

The interface is only able to detect a disconnection if

StatusCode.BadConnectionClosed

is given back on a read value.

It might be a good idea to read one value in a periodical way and to test if the connection breaks in this situation.

As a quick fix I am subscribing to the current time of the server which updates every second.

And this does keep the connection alive.

But this feels more like a dirty fix instead of a solution to the problem.

Answer
Not a bug

Yes I understand but the used Library gives us no direct information about disconnection events. And I don't know exactly in your case who is closing the communication when nothing happens - is it the client or the server. I am closing this issue because for the moment we don't have a better solution.