Page 1 of 1

Read User-Defined DataType in combination with OPC Binary

Posted: 13 Apr 2016, 19:11
by SysTester
Dear Support Team, dear users,

I'm trying to implement an OPC UA client by using parts of the sample code, provided by Unified Automation SDK. It works fine except for the "User defined types within inputArguments-field:
There is a field, which contains different attributes, one of those types is "ScanParameters", which was derived from 'Structure' ==> (according to UaExpert: {...|...|0|0|false|false|[enum]}) <= structure of the user-defined DT

By analyzing DataType-Tree I found definition of the dataType and a corresponding "OPC Binary" type-description. BUT: what about description/structure of the given datatype?
Where can i find information about datatype-fields (as given above)? What methods of the SDK can be used to achieve this?

It would be great, if someone could provide an example/sample code, how to extract definition and description of single fields of user defined datatypes, in order to fill those fields with values and to execute a call (method).

p.s.: by filling such dataTypes with values, which source-type must be used? E.g.:

Code: Select all

List<Variant> inputArgs = new List<Variant>(); // List of input arguments for a method
inputArgs.Add(new Variant("something")); // so far no problem
inputArgs.Add(....); // user defined datatype, which has Structure as BuiltInType?
Thank you for your help!

Re: Read User-Defined DataType in combination with OPC Binar

Posted: 13 Apr 2016, 22:26
by SysTester
EDIT: I found a solution based on C++ SDK but unfortunately there are no such classes in .NET SDK.
Can someone tell me, what equivalent classes can be used in .NET SDK to achieve similar goals?
http://forum.unified-automation.com/topic1592.html

Re: Read User-Defined DataType in combination with OPC Binar

Posted: 19 Apr 2016, 08:32
by SysTester
EDIT_2: I managed to solve the issue, by creating .cs Files with UaModeler from xml-Model.

Re: Read User-Defined DataType in combination with OPC Binar

Posted: 19 Apr 2016, 16:10
by Support Team
Hello,

You can get the information about unknown structured DataTypes using the DataTypeManager class.

If there is an ExtensionObject containing a value with an unknown structured DataType, you can use the method ParseValue. If you want to know the definition of a structured DataType, where the NodeId of the DataType is known, you can use the method NewTypeFromDataType.

Please see the ReadStructure example in Client GettingStarted.

Best regards
Support Team

Re: Read User-Defined DataType in combination with OPC Binar

Posted: 20 Apr 2016, 09:02
by marklendering

Re: Read User-Defined DataType in combination with OPC Binar

Posted: 20 Apr 2016, 09:07
by SysTester
Thank you very much for your assistance!