OPC UA Subscriptions and Notifications

PhotoKevin picture PhotoKevin · Apr 8, 2015 · Viewed 8k times · Source

I'm having trouble with OPC UA Subscriptions and Notifications in the ANSI C stack. OPC UA Part 4, Service says:

5.13.1 Subscription model 5.13.1.1 Description c) NotificationMessages are sent to the Client in response to Publish requests.

Sent how? I'm really expecting a callback of some sort, but there doesn't seem to be one. It does say these are in response to a 'Publish' request, but a Publish service call acknowledges receipt of a notification, it doesn't seem to request one. Besides, that would be polling and the whole point of Subscriptions and Monitoring is to not poll.

Can anyone supply an example showing monitoring of a data value in ANSI C?

Answer

Kevin Herron picture Kevin Herron · Apr 9, 2015

PublishRequests are queued on the server and responses are only returned when notifications are ready or a keep-alive needs to be sent (or a bunch of other stuff, check the state machine description in part 4).

They do include acknowledgements of previously received notifications as well, but the idea is that the response isn't expected immediately and that the client will generally keep pumping PublishRequests out so that the server has a queue of them ready to return notifications whenever a subscription needs to.

Yes, it's polling. It's a bit of a bummer that it's not strictly unsolicited, but that's how it works.

__

edit:

It's not really polling. It's batched report by exception with a QoS guarantee and back pressure mechanism provided by subsequent PublishRequests.