Casting EventTypes (ComServer Wrapper)|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
Casting EventTypes (ComServer Wrapper)
Avatar
Jan Herchenröder
New Member
Members
Forum Posts: 2
Member Since:
06/11/2016
sp_UserOfflineSmall Offline
1
11/08/2016 - 03:04
sp_Permalink sp_Print

Hi there,

 

I'm developing a small OPC UA Client (using .NET SDK) to access COM AE Server through the COMServerWrapper included in .NET SDK. The AE Server offers some different event types with additional event information accessible through attributes.

Now, when I create a subscription to the wrapped AE Server in my client, I get the events as COMAEBaseEventType with the fields (eventId, eventType, severity, etc...). The eventType field points to a subtype node, named after the correct AE event type. If I'm browsing this eventType, I see the AE event attributes as properties of type variable.

If I'm getting the monitoredItem.Notification as EventFieldList I only see the standard AE event fields. The question is, how do I "cast" this notification to the correct event type and read the special attributes?

I created some types with the ModelCompiler representing the different event types, but see no possibility to use these types. A little advice would be appreciated.

 

Greetings
Jan Herchenröder

Avatar
Paul Hunkar
Cleveland, Ohio, USA
Moderator
Members

Moderators-Specifications

Moderators-Companion

Moderators-Implementation

Moderators-Certification

Moderators-COM
Forum Posts: 112
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
2
11/16/2016 - 15:41
sp_Permalink sp_Print

Jan,

 I few comments - .Net SDk?  the OPC Foundation posts just sample code, I'm assumming that is what you are referring to?

 The COM AE Server wrapper available as part of the sample code will need some customization to make sure it includes you additional attributes that are available in the AE Server.  By Model compiler I'm assumming the OPC Foundation model compiler, which generates code and nodeset xml files for a server (so this will help you get the wrapper to expose the additional fields).

The sample AC client generates a subscription for events, as part of this subscription you specify which fields you would like from the events.  The default is just a subset of the available fields.   Did you add the additional fields you are looking for to the subscription?

Once all of this is correct you should see all of the fields you are looking for.

Paul

Paul Hunkar - DSInteroperability

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: David Puffer
Guest(s) 51
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855