Login  •  Register

Method Implementation - LinkModelToNode

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

Method Implementation - LinkModelToNode

Postby pfay » 10 Mar 2014, 12:55


I am trying to add method implementation logic behind my methods. When using simple types I can successfully add implementation logic, however when using more complex types with compositional aggregation relationships (objects within an object) I am having difficulties.

- Parent Object
- Parent Property
- Parent Method()
- Child Object
- Child Property
- Child Method()

When I add method implementation to the parent object only, LinkModelToNode(NodeId(ParentInstance), ParentMethodModel, ....) then its method implementation executes successfully. However if I also try to link method implementation to the child instance then the parent implementation logic fails to execute, LinkModelToNode(NodeId(ChildInstance), ChildMethodModel, ....).

What is the correct approach for adding method implementation for objects within objects?
Posts: 12
Joined: 10 Dec 2013, 11:52

Re: Method Implementation - LinkModelToNode

Postby Support Team » 14 Mar 2014, 10:42


There is an issue with the mapper and methods.
You need to call LinkModelToNode once for each sub-object.

Code: Select all
m_serverObject.Configuration.ModelHandle = m_rootNodeManager.LinkModelToNode(ObjectIds.ServerConfiguration, m_serverObject.Configuration, null, null, 1000);
m_serverObject.Configuration.ServerConfigurationMethods = this;

m_serverObject.Configuration.ModelHandle = m_rootNodeManager.LinkModelToNode(ObjectIds.ServerConfiguration_TrustList, m_serverObject.Configuration.TrustList, null, null, 1000);
m_serverObject.Configuration.TrustList.FileMethods = m_serverObject.Configuration.TrustList;

Best regards
Support Team
User avatar
Support Team
Hero Member
Hero Member
Posts: 2407
Joined: 18 Mar 2011, 15:09

Re: Method Implementation - LinkModelToNode

Postby maix » 22 Jan 2019, 08:46


has this problem been fixed in the meantime? I came across the same problem and found this post from 2014. Calling LinkModeltoNode for all child objects can be really annoying if you have lots of nested objects... I understand that this was a bug in 2014, but hasn't it been fixed until now? Or is there some other way how to set up methods for objects including all nested childs.

Posts: 1
Joined: 22 Jan 2019, 08:39

Return to .NET based OPC UA SDK

Who is online

Users browsing this forum: No registered users and 1 guest