PubSub Publish on demand

115 views
Skip to first unread message

Chris Rossi

unread,
Mar 2, 2022, 5:11:13 PM3/2/22
to open62541
I need to create a PubSub Publisher that does not send out data at some predetermined interval like all the examples show, but rather on demand only when my application determines that it is necessary. How can this be accomplished?

Siegfried Gipp

unread,
Mar 11, 2022, 3:20:01 AM3/11/22
to open62541
I'm quite new to this thing, and i have the exact same request. So if anyone knows how to, this would be double useful.

Siegfried Gipp

unread,
Mar 14, 2022, 9:10:19 AM3/14/22
to open62541
" In contrast to permanently reading information (polling), OPC UA provides a more elegant functionality, a so called Subscription. A UA Client can subscribe to a selection of Nodes of interest and let the server monitor these items. Only in case of changes, e.g. to their values, the server notifies the client about such changes."

So this feature should be available somehow.

Chris Rossi

unread,
Mar 14, 2022, 4:12:11 PM3/14/22
to open62541
My understanding is OPC UA PubSub was introduced just a few years ago and that client/server has been around much longer relatively speaking. So yes, there are a number of things available in the client/server model that is not available in PubSub. Things such as Events, Subscription and Alerts to name just a few. According to the OPC spec, PubSub Events have been defined but I don't believe they are implemented yet in open62541.

Siegfried Gipp

unread,
Mar 15, 2022, 1:29:20 AM3/15/22
to open62541
As far as my experiments show, Events and the like are existing and working. but these are server-only. That is, on event there is a callback that is called, but there is nothing sent to a client. Alarms and Conditions build upon Events, so it's the same. Open62541 has a very strict request/response system, so there is no data sent by the server without a request from the client. At least as far as i found until today. But there is something called a "Data Change Notification". At least in the specs. But i did not find this in open62541. And subscriptions seem to have only the fixed interval method.
I'm trying to understand all that since some months now and did not get that far as i was expected :(
Thanks for your answer :)

Götz Görisch

unread,
Jun 1, 2022, 2:20:28 AM6/1/22
to open62541
Dear all,

as PubSub is a topic with so many facets I would like to give an update from my side.
As you might know the OPC-F currently hosts a PubSub MQTT Demo at the Hannover Messe. I'm leading the UA for Machine Tools JWG and in this context we build an example implementation of PubSub (MQTT - UA JSON) for companion specification.
While doing this we had intensive discussions with the UA WG on the upcoming MQTT enhancements to part 14.

A few are already implemented here in our SampleServer. https://github.com/umati/Sample-Server/tree/pubsub-2
This implementation also adapts the datasets if the underlying address space is changing dynamically and has a prototype to publish the new DataSet meta data. (https://github.com/open62541/open62541/pull/5118)

I'm always open to discuss further things.

Goetz

Mariusz Postol

unread,
Jun 3, 2022, 3:41:00 PM6/3/22
to Götz Görisch, open62541
Hi All,

Let me share my staff related to the OPC UA PubSub
4. And many more - check out references at the end of articles and links inside the articles.

The work is undergoing as my research and education activity.

I did propose to the OPCF organization creation a training (for example on udemy.com) but it was refused.
Let me know if I can do something for the community. Let me stress that today I am not a member of the OPCF.

______________________________ 
Mariusz Postol, Ph.D. Eng. 
ul. L. Zeligowskiego, nr 43, lok. 29 90-644 Lodz POLAND 
Mobile: + 48 608 619899 
mailto:mpo...@cas.eu 


--
You received this message because you are subscribed to the Google Groups "open62541" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open62541+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open62541/237dff6e-0386-44b5-8f99-87c505cecd85n%40googlegroups.com.

Julius Pfrommer

unread,
Jun 9, 2022, 10:13:07 AM6/9/22
to open62541
Hey,

The open62541 PubSub defines UA_PubSub_CallbackLifecycle structure.

This callback lifecycle management is attached to thre ReaderGroup and WriterGroup config.
It allows to use an external interrupting mechanism for PubSub.
If you just want to manually trigger a publish, use

void UA_WriterGroup_publishCallback(UA_Server *server, UA_WriterGroup *writerGroup);

defined in the (private) API in /src/pubsub/ua_pubsub.h.

Regards,
Julius Pfrommer

Chris Rossi schrieb am Mittwoch, 2. März 2022 um 23:11:13 UTC+1:

Julius Pfrommer

unread,
Jun 9, 2022, 10:16:03 AM6/9/22
to open62541
Publishing of Events is implemented in this PR: https://github.com/open62541/open62541/pull/4220

It is basically done. But the original author did not respond to the review comments.
We triggered him once more a few weeks back. If there is no further response we will assign our own resources and finish the feature.

My guess is that the feature will land on master until autumn.

Regards, Julius

Chris Rossi schrieb am Montag, 14. März 2022 um 21:12:11 UTC+1:

Muddasir shakil

unread,
Jun 9, 2022, 10:37:41 AM6/9/22
to open62541
I think something similar is shown in the RT example, where publishing callbacks are called from the threads instead of server calling it. is this correct?
Reply all
Reply to author
Forward
0 new messages