How to get the node attribute handle for Writing values to t

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

Moderator: uasdknet

Post Reply
Jr. Member
Jr. Member
Posts: 2
Joined: 15 Jan 2019, 15:23

How to get the node attribute handle for Writing values to t

Post by arnebodin »

Upon creating the OPC Ua server, we firstly create objects like this:

cosSettings = new CreateObjectSettings()
ParentNodeId = onTunnelTypeNode.NodeId,
ReferenceTypeId = ReferenceTypeIds.Organizes,
RequestedNodeId = new NodeId(tSectionObject.szObject, InstanceNamespaceIndex),
BrowseName = new QualifiedName(tSectionObject.szObject, InstanceNamespaceIndex),
TypeDefinitionId = new NodeId(SVV.HBT.ObjectTypes.SectionType, TypeNamespaceIndex)
onSectionTypeNode = CreateObject(Server.DefaultRequestContext, cosSettings);

Then we have the nodes, but dont know how to get NodeAttributeHandle (nah) variable for the object:
sc = Write(Server.DefaultRequestContext, nah, null, dv);

I way to get this NodeAttributeHandle is to override the StartDataMonitoring procedure and subscribe the objects,
then the NodeAttributeHandle is received thru the second parameter MonitoredItemHandle.NodeHandle.

Do you have a way to retrive this NodeAttributeHandle thru the ObjectNode?

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

Re: How to get the node attribute handle for Writing values

Post by Support Team »


To get the NodeAttributeHandle you have to call GetNodeHandle. You need to call GetNodeHandle for each Variable you want to write.

Please note that there are other options to set or update the values of nodes. Please see our examples and tutorials.
If you want to set a value only once, you can call SetVariableDefaultValue after the creation of the object.
If the value should change during runtime, you should set the variable configuration to ExternalPolled or ExternalPushed and implement the required methods in your BaseNodeManager implementation. Please see the server getting started and the DemoServer example.
Best regards
Unified Automation Support Team

Jr. Member
Jr. Member
Posts: 1
Joined: 14 Sep 2019, 04:28

Re: How to get the node attribute handle for Writing values

Post by godisijoq »

Forum of the unification is dependent for the holding goals for the humans. The target of the instant assignment help is instituted for the program for the citizens. It is done for the culmination of the segments for the open ending of the story .

Post Reply