![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/guestdefault.png)
The AnsiC stack of the OPC Foundation provides a mapping of the services in OPC UA Part 4 to the UA TCP (https://opcfoundation.org/UA-P.....c-uabinary) and HTTPS with UA Binary (https://opcfoundation.org/UA-P.....s-uabinary). I.e. it provides an API that represents the services, the binary encoding, security policies and the protocol mapping as described in UA Part 6.
Any convenience functionality, like callbacks, will have to be provided in a higher level - like the sample library for .NET.
The OPC Foundation currently does not intend to provide such convenience features for AnsiC. You can either implement the functionality yourself, or look for a commercial solution.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
12/04/2015
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Convenience functionality? I don’t ask about any convenience functionality.
I ask about implementation of OPC UA standard communication protocol in Ansi C stack. Namely Part 5, chapter 5.12.1.1 Figure 15 and paragraph 2:
Notifications are data structures that describe the occurrence of data changes and Events. They are packaged into NotificationMessages for transfer to the Client. The Subscription periodically sends NotificationMessages at a user-specified publishing interval, and the cycle during which these messages are sent is called a publishing cycle.
I ask for information about mechanism in Ansi C stack that is designed for „receiving” NotificationMessages sent by „subscription”. I can imagine that it can be callback, pooling, long frame pooling or anything.
There must be such a mechanism because without it providing functions implementing „MonitoredItem Service Set” and „Subscription Service Set” would be completely useless. And Ansi C stack offers functions like OpcUa_ClientApi_CreateMonitoredItems and OpcUa_ClientApi_CreateSubscription that are parts of „MonitoredItem Service Set” and „Subscription Service Set”.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/guestdefault.png)
Ok, seems like I misunderstood.
To receive these "notification structures" you have to use the Publish Service specified in Part 4 - 5.13.5.
This is a long polling service, i.e. the server will queue it until he has something to report. At that time the server responds with a Publish response that includes the notification structure.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/guestdefault.png)
The ANSI C stack provides the necessary framework for building the behavior as described in Part 4, but doesn't actually contain the behavior. The behavior would normally exist in the SDK layer (above the stack).
Karl is right in that the Publish service is used by the Client to request update notifications (the equivalent to the 'callback' in Classic OPC). The Server will respond to the Client's Publish response with the appropriate notification messages (DataChanges, most likely). But like Karl alluded, there are timing and queuing requirements. Building this functionality will be complex and time-consuming.
The ANSI C stack was initially provided to allow toolkit vendors to build an SDK on top of it, and several have done so. I think this is where Karl was suggesting that a commercial offering may in fact be a more cost-effective solution for you since all of the hard work is already done thereby allowing you to focus exclusively on your application.
I hope this helps.
1 Guest(s)