OPC UA subscription life time |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 subscription life time
Avatar
RotatingWheel
Member
Members
Forum Posts: 12
Member Since:
01/27/2016
sp_UserOfflineSmall Offline
1
09/02/2018 - 06:37
sp_Permalink sp_Print

....

m_Subscription = new Subscription(session);
m_Subscription.PublishingEnabled = true;
m_Subscription.PublishingInterval = publishingInterval;
m_Subscription.DataChanged += SubscriptionOnDataChanged;
m_Subscription.NewEvents += SubscriptionOnNewEvents;
m_Subscription.StatusChanged += SubscriptionOnStatusChanged;

m_Subscription.Lifetime = 10000; 
m_Subscription.MaxKeepAliveTime = 10000; 
m_Subscription.Create();

With the above code, I lost subscription time to time meaning SubscriptionOnDataChanged is not called.  I was reading the document  and that says "The requested Lifetime may be overridden by the Server. Clients must check the CurrentLifetime property after creating or modifying a Subscription to see the value that the Server will actually use."

What does it mean for C# client? Can any body show or explain me?

Avatar
Randy Armstrong
Admin
Forum Posts: 1537
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
09/02/2018 - 12:07
sp_Permalink sp_Print

Lifetime only comes into play if the client stops sending publish requests. If there have been no publish requests after the Lifetime elapses the Subscription is closed by the server. If you are getting some publish responses then that is not the issue.

Avatar
RotatingWheel
Member
Members
Forum Posts: 12
Member Since:
01/27/2016
sp_UserOfflineSmall Offline
3
09/02/2018 - 21:46
sp_Permalink sp_Print

Thank you for reply,

Say we have a working session and subscription, how does client stop sending publish request? I have a C# unified automation client, I see that happens but not sure how my client is making request to stop it, I don't see any related code there.

Avatar
Randy Armstrong
Admin
Forum Posts: 1537
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
09/03/2018 - 04:59
sp_Permalink sp_Print sp_EditHistory

It won't happen if you are using an SDK.

How do you know you are missing updates in the client?
Are you sure the server is sending the update?

Note that processing lag will result in periodic missed updates if PublishingInterval == SamplingInterval.

Avatar
RotatingWheel
Member
Members
Forum Posts: 12
Member Since:
01/27/2016
sp_UserOfflineSmall Offline
5
09/03/2018 - 05:52
sp_Permalink sp_Print

I can see with Debugger in the C# client and  the subscription method is not called.

I can set value by UAExpert and that works OK, so problem is in my client side.  This is not processing lag.

My question how can I use the existing connection and tell server that server should publish data for client.

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