Reading dynamically added property fails

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

Moderator: uasdknet

Post Reply
vpsalo
Jr. Member
Jr. Member
Posts: 1
Joined: 09 Sep 2015, 10:57

Reading dynamically added property fails

Post by vpsalo »

Hi

This might be a duplicate, but we have created a .NET SDK based UA Server and we are adding item properties dynamically.

Property is created like this

PropertyState ps = new PropertyState(this);
ps.NodeId = BuildChildNodeId(name, namespaceIndex);
ps.ReferenceTypeId = ReferenceTypeIds.HasProperty;
ps.TypeDefinitionId = VariableTypeIds.PropertyType;
ps.SymbolicName = name;
ps.BrowseName = new QualifiedName(name);
ps.DisplayName = new LocalizedText(ps.BrowseName.Name);
ps.Description = null;
ps.WriteMask = 0;
ps.UserWriteMask = 0;
ps.DataType = (uint)dataType;
ps.ValueRank = ValueRanks.Scalar;
ps.AccessLevel = AccessLevels.CurrentRead;
ps.UserAccessLevel = AccessLevels.CurrentRead;
ps.MinimumSamplingInterval = MinimumSamplingIntervals.Indeterminate;
ps.Historizing = false;
ps.Value = initialValue;
return ps;

and then added to address space using
PropertyState property = CreateProperty(name, dataType, namespaceIndex, initialValue);
nodeState.AddChild(property);

When reading value, the property returns BadNodeIdUnknown (0x80340000)

What might be the reason? Thanks!

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

Re: Reading dynamically added property fails

Post by Support Team »

Hello,

We need some more information. In the whole SDK a class called PropertyState does not exist. Also a methods called CreateProperty or AddChild are not part of the SDK.
Please post your code for the unknown classes / methods.

What version of the SDK are you using?

Best regards
Support Team

Post Reply