I see 2 properties in Subscription in OPC UA implementation. I see the following code but not sure why those are used? Can anybody explained me?
m_Subscription.Lifetime = 10000;
m_Subscription.MaxKeepAliveTime = 10000;
Subscription Lifetime and MaxKeepAliveTime in OPC UA
Moderator: uasdknet
-
- Sr. Member
- Posts: 13
- Joined: 18 Feb 2016, 21:47
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re: Subscription Lifetime and MaxKeepAliveTime in OPC UA
See here for Lifetime:
http://documentation.unified-automation ... cacfb83fb6
See here for MaxKeepAliveTime:
http://documentation.unified-automation ... e2af234251
http://documentation.unified-automation ... cacfb83fb6
See here for MaxKeepAliveTime:
http://documentation.unified-automation ... e2af234251
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Sr. Member
- Posts: 13
- Joined: 18 Feb 2016, 21:47
Re: Subscription Lifetime and MaxKeepAliveTime in OPC UA
Thanks for reply, what does it mean in practice, is the subscription is deleted after that time? If subscription is expired how client can re initialize it by C# application client?
I have a problem in our application that sometimes client doesn't update the UI (though there is datachange in server)and if I restart the client application then it starts to work again. Just wonder what could be the issues here. Our client is written in C#
I have a problem in our application that sometimes client doesn't update the UI (though there is datachange in server)and if I restart the client application then it starts to work again. Just wonder what could be the issues here. Our client is written in C#
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re: Subscription Lifetime and MaxKeepAliveTime in OPC UA
Hello mrahman252003,
the lifetime only expires if the client stops sending publish requests which never happens in normal operation. The SDK (client side) takes care of that. If you stop getting data that probably has a different reason.
If the client reconnects or the subscription gets invalid the SDK should handle the situation gracefully.
1) Did you implement the subscription callbacks in your client'? If the subscription gets invalid the SDK will inform you about that.
See:
http://documentation.unified-automation ... 28a1ecbc5f
2) Turn on the trace and see what happens
See:
http://documentation.unified-automation ... raceLevels
the lifetime only expires if the client stops sending publish requests which never happens in normal operation. The SDK (client side) takes care of that. If you stop getting data that probably has a different reason.
If the client reconnects or the subscription gets invalid the SDK should handle the situation gracefully.
1) Did you implement the subscription callbacks in your client'? If the subscription gets invalid the SDK will inform you about that.
See:
http://documentation.unified-automation ... 28a1ecbc5f
2) Turn on the trace and see what happens
See:
http://documentation.unified-automation ... raceLevels
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Sr. Member
- Posts: 13
- Joined: 18 Feb 2016, 21:47
Re: Subscription Lifetime and MaxKeepAliveTime in OPC UA
Hi,
We have implemented but it does not take any action (this is not my work, I just inherited from other). I see the following logs are printed
changed from Created to WarningKeepAliveLate (BadCommunicationError) by the code
Most time, after the connection breaks, client get connected automatically but sometimes it does not. When connection is reestablished the I see the following logs are printed
Do you think, if I see Created status then I should create new subscription ? But I see we are calling the subscription creation method when we get connection status changed to connected. Sometimes, somehow it miss the subscription and UI is not updated. Is it harmful if I create subscription 2 times to make sure we have subscription? Biggest problem here, I can't reproduce the error, no idea when it occurs.
We have implemented but it does not take any action (this is not my work, I just inherited from other). I see the following logs are printed
changed from Created to WarningKeepAliveLate (BadCommunicationError) by the code
Code: Select all
private void SubscriptionOnStatusChanged(Subscription subscription, SubscriptionStatusChangedEventArgs statusChangedEventArgs)
{
// TODO: any problems occurring with subscriptions should be handled accordingly
log.InfoFormat("changed from {2} to {3} ({4})", statusChangedEventArgs.OldStatus, statusChangedEventArgs.CurrentStatus, statusChangedEventArgs.Error);
...
Code: Select all
changed from Deleted to Created (Good)