OPC UA C# client subscription issue

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
mrahman252003
Sr. Member
Sr. Member
Posts: 13
Joined: 18 Feb 2016, 21:47

OPC UA C# client subscription issue

Post by mrahman252003 »

I inherited some C# opc ua client code. I see we loose subscription time to time.

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 am not explicitly calling to stop publish. To get the working subscription back what I should do?

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

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: OPC UA C# client subscription issue

Post by Support Team »

Hello,

Is SubscriptionOnStatusChanged EventHandler called? Is the connection established the whole time, or is the client in a reconnect loop?
Best regards
Unified Automation Support Team

Post Reply