Detect lost OPC connection faster

Hello,
I am running an OPC UA Server on a Siemen PLC. We are tracking the communication between gateway and server by a derived tag towards [System]Gateway/OPC/Connections/{OPC Server}/Connected. We noticed that it takes between 30 and 40 seconds until the connection is considered lost. For our system this takes too long.

So, I put in some effort to investigate the advanced settings. After reading the documentation and conducting my own experiments, I still have difficulty fully understanding which setting affects the value in what way. I was able to determine that there is a difference between the status of the OPC UA connection and the tag quality. The tag mentioned above changes its value when the quality of the tags turn bad. I have not yet been able to figure out exactly what influences the quality.

I played around with "Request Timeout" setting. When this setting is very low the quality changes as soon as the OPC connection is considered lost. However, when I increase the time for "Request Timeout", the time between OPC connection is faulty and the tag quality turns bad does not match up with the time defined in the settings. Can somebody explain me what setting is influencing the tag quality?
I made a picture to show how I understand the settings. It would be nice if somebody can confirm or correct that.

Besides that, does somebody know if there are some rules that should be followed. Something like "Request Timeout" must be three times "Keep-Alive timeout" or whatever :slight_smile:

Kind regards

Keep Alive Failures Allowed and Keep Alive Interval are probably the settings you want.

The interval is how often we do a "keep alive" request; the failures allowed is how many are allowed to fail before we decide the connection is lost.

All of this is only necessary to detect "unclean" shutdowns where the server doesn't properly close the TCP connection, but since you're here posting I'm guessing that's the case.

Thank you that helped me a lot :slight_smile:
I misunderstood the Keep Alive Failures Allowed setting.

yes, you are right. The test ist to unplug the cable or turn off the PLC and then check how long it takes to detect it.