Decode binary structured data from ExtensionObject | OPC UA Implementation: Stacks, Tools, and Samples | Forum

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
Decode binary structured data from ExtensionObject
Avatar
huebener.se@schmid-group.com
New Member
Members
Forum Posts: 2
Member Since:
11/11/2015
sp_UserOfflineSmall Offline
1
03/22/2020 - 12:01
sp_Permalink sp_Print

Hello,

I'm trying to find a way to parse the binary structured data from an ExtensionObject.
I know, how to get the correct DataTypeNode of the received data. But didn't find any way on how to use it to decode the binary data.

Hopefully, anyone can give me a hint how to do this with the .NET SDK.

Thanks!

Avatar
Randy Armstrong
Admin
Forum Posts: 361
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
03/23/2020 - 09:34
sp_Permalink sp_Print

https://github.com/OPCFoundati.....Encoder.cs

public ExtensionObject ReadExtensionObject(string fieldName)

Avatar
huebener.se@schmid-group.com
New Member
Members
Forum Posts: 2
Member Since:
11/11/2015
sp_UserOfflineSmall Offline
3
03/23/2020 - 10:39
sp_Permalink sp_Print

Thanks for your reply!
But how do I use the Binary decoder? And whats the fieldName?
Is there a possibility to the the DataTypeNode for the decoder?

The following code does not work...

DataValue Data = GetDataFromServer(...);
var ExtData = GenericData.Value as ExtensionObject;

using var Decoder = new BinaryDecoder(ExtData .Body as byte[], ServiceMessageContext.GlobalContext);
var Result = Decoder.ReadExtensionObject(null);

Forum Timezone: America/Phoenix
Most Users Ever Online: 143
Currently Online:
13
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Newest Members:
veronkerhen@yandex.ru
Forum Stats:
Groups: 2
Forums: 9
Topics: 630
Posts: 1831

 

Member Stats:
Guest Posters: 1
Members: 123986
Moderators: 10
Admins: 2
Administrators: michael.bryant@opcfoundation.org, Randy Armstrong
Moderators: matthias.damm@ascolab.com, s.hoppe@beckhoff.com, paul.hunkar@dsinteroperability.com, jouni.aro@prosys.fi, tim.fortin@honeywell.com, Jim.Luth@Schneider-Electric.com, Karl-Heinz Deiretsbacher, stefan.hoppe@opcfoundation.org, alexander.allmendinger@opcfoundation.org, Karl Deiretsbacher