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
Trying to set the subscription rate (Prosys simple client / UA Simulation Server)
October 26, 2016
18:23, EEST
Avatar
Mark Petty
Member
Members
Forum Posts: 11
Member Since:
October 26, 2016
sp_UserOfflineSmall Offline

Hi,

I’m working on a Proof of Concept project where one of the requirements is getting the subscription rate to 100 ms. I’m working with the SimpleClient code that comes with the SDK and am talking to the Prosys OPC UA Simulation Server. In specific, I’ve set up a subscription for the DataItem_0000 node and am displaying the value.

I tried resetting the subscription interval to 100ms using the “i” command but that didn’t seem to change the update from 1000 ms, so I then hardcoded the new value by calling subscription.setPublishingInterval(100) after calling createSubscription() in SampleConsoleClient::subscribe (), and that didn’t seem to change anything either.

I’d appreciate some guidance. Can I not set it below 1000 ms? Does the Simulation Server limit it to 1000 ms? Am I calling the wrong method or in the wrong place?

-Thanks
-Mark

October 26, 2016
18:49, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

The default change rate for the variables in the Simulation Server is 1 s. In order to get more samples, you need to change that in the server, under the Simulation tab.

August 3, 2021
10:23, EEST
Avatar
amj005
Member
Members
Forum Posts: 33
Member Since:
July 27, 2021
sp_UserOfflineSmall Offline

Hi,

I understand that the timeout works as per the limit or changes in simulation server.
But is there a way to change it such that, get a value every 100ms, even if there is no change in server?
i.e. I am looking for synchronous subscription with the server, instead of asynchronous( where we get value only on change in server).

August 3, 2021
10:40, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Could it be possible to explain your use-case? Also is this “100ms” a real-time requirement or an informative/approximate value?

OPC UA Subscriptions by their definition are what you are calling asynchronous. There is no such thing as a “synchronous Subscription” in OPC UA (sort-of-except if you instead mean the Part 14 PubSub thing; see P.S. part).

The “OPC UA way” to do what you say synchronous would be to do a periodic Read operation from a client. Though, in most cases a Subscription should be used instead of doing this. Also, note that it is quite hard to get the timing to be exact.

This might not be what you would be looking for, but the Subscriptions with their MonitoredItems are quite configurable in OPC UA: https://reference.opcfoundation.org/Core/docs/Part4/7.17.2/ you could set a DataChangeTrigger so that a timestamp change in the server would also trigger a datachange (i.e. not just the value itself changing). It would still require that at least the timestamp would change.

P.S.
Depending on things, the Part 14 “PubSub” added in OPC UA 1.04 could be what you are looking for: https://reference.opcfoundation.org/Core/docs/Part14/, though none of our apps include it yet. SDK has some support (server-to-server or server-to-cloud/mqtt+json). Howerver it should be noted that this is sort of, well, “completely different” from the “normal” client-server OPC UA. And most likely if you have an “OPC UA Server”, it wont support PubSub yet.

August 3, 2021
11:10, EEST
Avatar
amj005
Member
Members
Forum Posts: 33
Member Since:
July 27, 2021
sp_UserOfflineSmall Offline

Thanks for your inputs! I will go through the pubSub, as I am new to OPCUA as well.

Usecase: I would need to get value of the node from server every x seconds(configurable), if it is marked as synchronous read(configurable). The value can be old value, if it has not changed.
And if it is marked as asynchronous read, need to get value only when there is change.
I can have a list of nodes, where some marked as synchronous and some marked as asynchronous.

August 3, 2021
11:34, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

At least based on that description I would just make a Subscription with MonitoredItems per node in your list and cache the values in the client side. That way you will know the latest value for all “synchronous” operations (I’m assuming something polls you application for these) and can use the DataChangeNotifications i.e. updating of the cache as a trigger to send notifications to your “asynchronous” ones.

P.S.
Note that I did mention PubSub only because it sort of “fit” the description (only cyclic data sending server-wise; plus in the future with https://en.wikipedia.org/wiki/Time-Sensitive_Networking it could be deterministic real-time) , but in practice it most likely is not what you would want here (like 99% likelihood that the server you have doesn’t support it). It can be quite complicated, since it sort of builds on top of everything in the traditional client-server OPC UA and is basically sort of a completely new protocol.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

Moderators: Jouni Aro: 1010, 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