OPC UA Client .NET - subscription stops after a certain time or event|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
OPC UA Client .NET - subscription stops after a certain time or event
Avatar
mro
New Member
Members
Forum Posts: 2
Member Since:
07/04/2017
sp_UserOfflineSmall Offline
1
08/01/2017 - 03:01
sp_Permalink sp_Print sp_EditHistory

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
RotatingWheel
Member
Members
Forum Posts: 12
Member Since:
01/27/2016
sp_UserOfflineSmall Offline
2
08/07/2017 - 04:15
sp_Permalink sp_Print

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.

https://opcfoundation.org/foru.....c-is-lost/

Avatar
mro
New Member
Members
Forum Posts: 2
Member Since:
07/04/2017
sp_UserOfflineSmall Offline
3
08/07/2017 - 12:01
sp_Permalink sp_Print

Hi,

What did you try exactly ?

Avatar
RotatingWheel
Member
Members
Forum Posts: 12
Member Since:
01/27/2016
sp_UserOfflineSmall Offline
4
08/07/2017 - 14:05
sp_Permalink sp_Print

In my case this happens randomly or I don't know how to reproduce. Every now and then client is not updated though there is active connection in OPC level. I have tried to debug our app but no luck.

Avatar
Frederick Loveless
Member
Members
Forum Posts: 20
Member Since:
10/02/2014
sp_UserOfflineSmall Offline
5
08/07/2017 - 14:40
sp_Permalink sp_Print

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
Paul Hunkar
Cleveland, Ohio, USA
Moderator
Members

Moderators-Specifications

Moderators-Companion

Moderators-Implementation

Moderators-Certification

Moderators-COM
Forum Posts: 109
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
6
08/15/2017 - 22:55
sp_Permalink sp_Print

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

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 41
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1353
Posts: 4589