NodeHandleType.Internal and random variables

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

Moderator: uasdknet

Post Reply
Sergey
Jr. Member
Jr. Member
Posts: 1
Joined: 27 Sep 2013, 14:45

NodeHandleType.Internal and random variables

Post by Sergey »

Hello everyone,

I'm a beginner in OPC UA and in C#. I spent last week on reading and trying to crate OPC UA client-server.
I was following to Getting Started manual. I created my own Address Space with Objects and Variables in UaModeler and integrated it into a VS project. I can access and see all things in UA Expert when I am running the solution.
Now I would like to have variables in-memory and update them with some time interval with random values.
I need to us SetVariableConfiguration method and install a NodeHandleType.Internal parameter for all tags according to the manual.

VariableNode variable = SetVariableConfiguration(
new NodeId("SomeString1", InstanceNamespaceIndex),
new QualifiedName("SomeString2", InstanceNamespaceIndex),
NodeHandleType.Internal,
object handleData );

I can not understand what I should use as "object handleData" in this case. Could anyone help me with this?
Thank you in advance.

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

Re: NodeHandleType.Internal and random variables

Post by Support Team »

Hello Sergey,

The handleData is the UserData that will be added to the NodeAttributeHandle that is passed to the Read method. You can create your own UserData class and use it for SetVariableConfiguration. You can cast the UserData property of the nodeHandle passed to the Read method and use your UserData for getting the values.

You should have a look at the DemoServer project. You can see here examples for the usage of SetVariableConfiguration and how the UserData is used for Read, Write, StartDataMonitoring, ... . Just search for SetVariableConfiguration and DataSourceAddress.

You should also have a look at the different NodeHandleTypes (http://documentation.unified-automation ... deMan.html).

Best regards
Support Team

Post Reply