Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Subscription and Publish
April 12, 2022
16:01, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hi,
I have an opc ua server that calculates alarms and triggers events. My opc ua client subscribes to these alarms.
My question is how to act on the subscription parameters : PublishInterval, MaxKeepAliveCount, LifetimeCount
to optimize the processing time between the server and the client ?

Thanks

April 13, 2022
9:03, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

What do you mean with “to optimize the processing time between the server and the client”? PublishInterval, MaxKeepAliveCount, LifetimeCount parameters of a Subscription control how often Notifications are sent to the Client, how often keep-alive messages are sent to the Client when there are no Notifications to send and how long it will take before the Subscription is closed after receiving no Publish requests from the Client.

How to set these parameters depends on what you want to do and there is no single “optimized” way to set them.

If you want to receive Notifications more often, use low PublishInterval. If you want Subscriptions to inform the Clients that are alive often or seldom, use low or high MaxKeepAliveCount respectively. If you want Subscriptions to persist for long even without contact from Client, use high LifetimeCount.

Remember that Servers are allowed to revise these parameters to values they support. For more information, see https://reference.opcfoundation.org/Core/docs/Part4/5.13.1/ and https://reference.opcfoundation.org/Core/docs/Part4/5.13.2/

April 13, 2022
15:21, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,
By “to optimize the processing time between the server and the client” i mean that, having the time to go from server alarms to clients in the range of 300 milliseconds to 800 milliseconds for example.

April 13, 2022
15:42, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

I’m assuming that you’re talking about the time it takes from a Server generating an Alarm to a Client receiving a Notification about this Alarm. In that case, you can try to lower the PublisingInterval to have the Server send Notifications more often. But as mentioned before, Server’s can revise the requested PublisingInterval if the requested value is not supported.

When using lower PublishingIntervals, you should use higher MaxKeepAliveCount and LifetimeCount to avoid the Subscription from timing out too soon or sending keep-alive messages too often.

April 28, 2022
10:41, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,
Thank you for your response. So, for example if i set PublishingIntervals to 500 ms,
what values should I set for MaxKeepAliveCount and LifetimeCount ?

Thanks

April 28, 2022
13:03, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

The values you should use for MaxKeepAliveCount and LifetimeCount depend on your application. Their effect on the Subscription has already been explained in earlier posts in this thread. Adjust MaxKeepAliveCount based on how often you wish to receive keep-alive messages and LifetimeCount based on how long it should take before a Subscription should time out.

The default PublishingInterval is 1000 ms, LifeTimeCount is 60 intervals and MaxKeepAliveCount is 20 intervals. Since you have halved the PublishingInterval to 500 ms you could double LifeTimeCount to 120 and MaxKeepAliveCount to 40 to keep the “default durations” for Subscription timing out and for sending keep-alive messages respectively. This is just one suggestion, though. The proper values depend the needs of your application.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
13 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 679

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1