PubSub - Publishing 2 datasets

34 views
Skip to first unread message
Message has been deleted

Charan Raj O

unread,
Jan 22, 2025, 7:36:26 AM1/22/25
to open...@googlegroups.com

 

Hi Team,

 

This is regarding broker less pubsub publisher implementation and I have used examples from open62541 library.

 

I want to publish two datasets and I want to publish these datasets on event basis. It is similar to “server_pubsub_publisher_on_demand.c” example but in example “server_pubsub_publisher_on_demand.c” the publish API (UA_Server_WriterGroup_publish) was not publishing any data when called inside the “onDemandPublish” call back function for event basis. So I made below mentioned changes in pubsub writerGroup configuration then the publish API (UA_Server_WriterGroup_publish) started to work.

               

Changes made: In WriterGroup configuration I added “addCustomCallback” and made publishing interval as 0 because I don’t want to publish datasets periodically. Our requirement is event based.

 

I wanted to publish 2 datasets with event basis so I used “server_pubsub_publisher_iop.c“ example program from open62541 with above configuration and added publish API (UA_Server_WriterGroup_publish) inside “timerCallback” call back function.

 

Please let me know my approach is correct or do I need to make any changes?

 

For above implementation I have found few observation and please can you tell me why I have observing these,

  1. In dataset configuration if I configure promotedField as false then only publish dataset 2 will publish and dataset 1 will not publish.

So I made promotedField as true then both datasets started to publish but in Wireshark I can see that there are 2 UDP messages transmitting for each dataset.

So my question is,

  1. Why only one dataset is publishing when promotedField is false.
  2. Why it is taking two messages to publish 2 datasets when promotedField is true.

 

  1. To publish the 2 datasets using API “UA_Server_WriterGroup_publish” in “timerCallback” call back function I required to add “addCustomCallback“ in writer group configuration(UA_Server_addWriterGroup) without any instructions inside call back function as shown below,

 

So my question is,

  1. Why I need to add this call back configuration in writer group configuration(UA_Server_addWriterGroup)?

 

My updated program is attached for your reference.

 

Thanks and Regards,

Charanraj O



This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you
server_pubsub_publisher_iop_2_dataset.txt
Reply all
Reply to author
Forward
0 new messages