Question Regarding Subscription class and how datachange_notification works #1413
-
I had a question regarding how datachange_notification works. If I have created an instance of a subscription handler that updates opcua node values, how does this work in relation to datachange_notification? The subscription takes in a period for how often it receives from the publisher, but my understanding is that datachange_notification is only triggered when a change in opcua value occurs? More clarification on this would be helpful. Also, how does one determine if the client is getting stale opcua values in a sub-pub situation? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
a opc ua subscription and pubsub are two different things! https://reference.opcfoundation.org/v104/Core/docs/Part4/5.13.1/ In simple words: |
Beta Was this translation helpful? Give feedback.
-
@AndreasHeine To ensure that the queue actually gets emptied, and we get the most up to date, should we have the subscribing rate be higher than the publishing rate from the server? Also, what is the perceived benefit of having a queue size greater than 0? Would this even be a benefit if we can ensure that the subscribing rate is higher than the publishing rate? |
Beta Was this translation helpful? Give feedback.
-
This doesn't make sense to me. If lets say the queue of a node value, that is a bool, is 10 messages, how can a value be a list of 10 messages if its supposed to be either true or false? Another way to put my question: If after each publishresponse the client receives all notifications from the queue for the MonitoredItem (in this case a bool) to the Client, how does the client process these values? |
Beta Was this translation helpful? Give feedback.
-
@AndreasHeine What is the difference (conceptually) between the publish interval and the sampling interval? It seems like one is specific for each MonitoredItem and the other applies generally for the subscription. Thank you so much for your detailed answers! |
Beta Was this translation helpful? Give feedback.
a opc ua subscription and pubsub are two different things!
https://reference.opcfoundation.org/v104/Core/docs/Part4/5.13.1/
In simple words:
A OPC UA Subscription works like a "Mailbox" which gets emptied in a defined interval by the Client. The OPC UA Client sends a publishrequest, the server takes all notifications since the last publishrequest and send them in the publishresponse to the client. If there is no Notification in the "Mailbox" the Client will get a "keep-alive" back. The OPC UA Client can add "MonitoredItems" to the Subscription which will generate Notifications.