Missing method arguments on type instance

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
martenbyebye
Hero Member
Hero Member
Posts: 21
Joined: 03 Mar 2017, 16:08

Missing method arguments on type instance

Post by martenbyebye »

Hi,

I define a type with a folder that has a method. This method has InputArguments and OutputArguments. The UA-Expert uses them when I press Call Method. All is good here.

But when I create an instance of that type, the UA Expert cannot see the arguments. (I can browse to the method on the instance). A client can still call the method successfully if it somehow knows the input arguments, but the UI/browsing has a problem. The userData is properly set on the instance method node.

Here is what I am doing:
- create type with folder with method
- create instance of type
- call nodeManager.SetChildUserData on instance method node

Does anyone know what I am missing?

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

Re: Missing method arguments on type instance

Post by Support Team »

Hello,

If the arguments nodes are having a reference to ModellingRule Mandatory, the nodes are created when calling CreateObject or CreateMethod.

If the ObjectType is created with UaModeler, the ModellingRule is always added to the arguments nodes. If the ObjectType is created in code with CreateObjectType and CreateMethod, the arguments nodes do not get a ModellingRule. The next version of the .NET SDK will fix this issue.
As a workaround you can set the ModellingRule to the arguments nodes explicitly:

Code: Select all

var method = CreateMethod(Server.DefaultRequestContext, settings);
VariableNode property = FindInMemoryNode(method.NodeId, ReferenceTypeIds.HasProperty, false, "InputArguments") as VariableNode;
property.ModellingRuleId = ObjectIds.ModellingRule_Mandatory;
Best regards
Unified Automation Support Team

martenbyebye
Hero Member
Hero Member
Posts: 21
Joined: 03 Mar 2017, 16:08

Re: Missing method arguments on type instance

Post by martenbyebye »

Everything was created in code. The provided code works perfectly. Thanks!

Post Reply