Using Methods with own VariableTypes?

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
AnyOne
Full Member
Full Member
Posts: 9
Joined: 25 Apr 2013, 09:54

Using Methods with own VariableTypes?

Post by AnyOne »

Dear Supportmembers,

I work on a project with UaModeler, including quite a few object- and variable types and need to create a lot of methods. However there seems to be no way to choose a "TypeDefinition" for my methods' arguments.
Please correct me if I misunderstood, but as MethodNodes only feature an array of InputArguments, I understand the arguments are of type "Property" and can therefore not be assigned any other TypeDefinition, right?

Does the OPC UA specification limit the use of input arguments to BasicDataTypes with PropertyType or is this behaviour specific to UaModeler? (I couldn't find any advice in the specs)

Say I have a function (fictional examplefunction in pseudocode)

Code: Select all

 moveIt( [in] struct Units, [in] struct Values, [in] enum RotationDirection, [out] struct MyEndPoint)
now let's assume the arguments are supposed to be VariableTypes derived from BaseDataVariable containing other variables such as:

Code: Select all

Units { 
   distance: inches, //(Enum)
   time: seconds,  //(Enum)
   weight(Enum): lbs   //(Enum)
} 
and so forth.

Being told that using custom DataTypes is not a good idea if the provider shall be of any use to generic clients, I wonder:
Is there a way I can pass this DataVariable - which imitates a structure - to the function or do I need to disassemble it to its components? (which is quite a lot of writing for many different scenarios)...

I would highly appreciate your advice on this topic.

Sincerely
AnyOne

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: Using Methods with own VariableTypes?

Post by Support Team »

Hello AnyOne,

In OPC UA the method arguments are described by a DataType and a ValueRank. The arguments are values not nodes. So the arguments do not have a TypeDefinition. The PropertyType TypeDefinition is used for the node which describes the method arguments.

You are right that most generic clients cannot interpret custom structures. But in future generic clients will be able to read the TypeDictionary from the server and interpret custom DataTypes.

Best regards,
Unified Automation Support Team

AnyOne
Full Member
Full Member
Posts: 9
Joined: 25 Apr 2013, 09:54

Re: Using Methods with own VariableTypes?

Post by AnyOne »

Dear Support Team,

thank you for the quick response.
How far away is this future?

Sincerely yours

AnyOne

Post Reply