![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
07/04/2017
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Hello,
I have a problem with an application I am developping, using Opc.Ua.Client assembly. It subscribes to a Siemens OPC server tag and read some values when this tag changes. Seems simple but after about one day working, the script stops receiving data. The event is not received anymore as if it was disconnected.
I tried to set the SubscriptionLifetimeCount to the maximum, the SubscriptionKeepAliveCount to 2 and created a thread that reconnects the client no matter its status. I launched that script at friday 28/07 8pm and after five events raised (only on monday) it has stopped on 31/07 at about 3pm.
Does anybody know something about this please ?
Best regards.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
01/27/2016
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Seems I have similar problem and posted a question to this forum. For me there is active connection between client and server but no data is exchanged. May be there is a bug in OPC-UA, we can work together to find a solution or work around.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
10/02/2014
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
So in OPC UA a server uses the lifetime count to determine how many times it should cycle through a the publishing intervals with out being able to send a publish response when it has data to publish. The way publishing should work is that the client should send 1 or more publish requests to the server for each subscription.On a publish interval if there is data for a subscription the server will dequeue a request and send a response, if there is none then on the lifetime count it will send dequeue a request and send a status update letting the client know that the subscription is still alive. If the client has no publish requests to dequeue it will eventually cancel the subscription at which point the keep alive reuqest to get the server status will succeed but there will never be another publish response. You should be able to do a registered or unregistered read of the sever and get data though. The client should always send a new request when it does get a response to make sure there are always enough requests queued.
Possible causes can be that the client does not send enough publish requests initially or in response to responses and the queue becomes empty.
The client does not send subscription status requests which will tell it if subscriptions are still active in the server. (Most UA clients do not do this.)
The client did not renew the session before the session timeout.
I would get a wire shark capture and look at what is happening. You should be able to see what I am talking about. Wireshark will decode the UA Packets if you are not using encryption and you know the port number of the endpoint.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/moderatordefault.png)
Moderators-Specifications
Moderators-Companion
Moderators-Implementation
Moderators-Certification
Moderators-COM
02/24/2014
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
To add a little more to Fred's excellent response. Secure connection make use of a symmetric key, that is established as part of the open secure channel/create session interactions. these symmetric keys need to be renewed periodically (they expire). If a client does not renew the session(symmetric key) the session will end even if a subscription is active. it will end do to s security issue. So even if a client send enough publish requests to the server , the connection may still end if the session is not renewed. SO either the lack of publish requests or the session issue can cause the described problem. It is recommened that application be certified - the certification process will check that all of this behavior is correct
Paul
Paul Hunkar - DSInteroperability
1 Guest(s)