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!
Reading dynamically added property fails
Moderator: uasdknet
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: Reading dynamically added property fails
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
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