Ansi C Stack - notifications from subscriptions - how?|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Ansi C Stack - notifications from subscriptions - how?
Avatar
JAROSŁAW JASIŃSKI
Member
Members
Forum Posts: 5
Member Since:
12/04/2015
sp_UserOfflineSmall Offline
1
03/17/2016 - 01:25
sp_Permalink sp_Print

I am creating OPC UA client using Ansi C Stack. I can’t find a mechanism in the stack that could be used for receiving notifications from subscriptions. How can I provide my callback function for receiving notifications from subscriptions?

Avatar
Guest
Guests
2
03/18/2016 - 00:11
sp_Permalink sp_Print

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
JAROSŁAW JASIŃSKI
Member
Members
Forum Posts: 5
Member Since:
12/04/2015
sp_UserOfflineSmall Offline
3
03/18/2016 - 01:16
sp_Permalink sp_Print sp_EditHistory

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
Guest
Guests
4
03/18/2016 - 07:45
sp_Permalink sp_Print

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
Guest
Guests
5
03/18/2016 - 08:15
sp_Permalink sp_Print

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.

Avatar
JAROSŁAW JASIŃSKI
Member
Members
Forum Posts: 5
Member Since:
12/04/2015
sp_UserOfflineSmall Offline
6
03/21/2016 - 01:09
sp_Permalink sp_Print

Thank you for your help. That is what I was looking for.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 24
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1341
Posts: 4546