18:23, EEST
October 26, 2016
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
18:49, EEST
December 21, 2011
10:23, EEST
July 27, 2021
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).
10:40, EEST
April 3, 2012
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.
11:10, EEST
July 27, 2021
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.
11:34, EEST
April 3, 2012
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.
Most Users Ever Online: 1919
Currently Online:
20 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 727
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1