I can dynamically create a node through method node calls, but cannot see it in UAExpert without manually looking for it (Createcustomnode with same nodeId shows the node in 'data access view'). Restarting UAExpert after node creation doesn't fix this issue. How can I solve this problem?
Thanks
public ServiceResult AddNodeMethod(ISystemContext context, MethodState method, IList<object> inputArgs, IList<object> outputArgs0)
{
BaseDataVariableState variable = new BaseDataVariableState(opcUaServer);
variable.SymbolicName = "THISISATEST";
variable.ReferenceTypeId = ReferenceTypes.Organizes;
variable.TypeDefinitionId = VariableTypeIds.BaseDataVariableType;
variable.NodeId = new NodeId((uint)2099, NamespaceIndex);
variable.BrowseName = new QualifiedName("TEST2");
variable.DisplayName = new LocalizedText("en", "Thisisatest");
variable.WriteMask = AttributeWriteMask.DisplayName | AttributeWriteMask.Description;
variable.UserWriteMask = AttributeWriteMask.DisplayName | AttributeWriteMask.Description;
variable.DataType = DataTypeIds.Int32;
variable.ValueRank = ValueRanks.Scalar;
variable.AccessLevel = AccessLevels.CurrentReadOrWrite;
variable.UserAccessLevel = AccessLevels.CurrentReadOrWrite;
variable.Historizing = false;
variable.Value = 0;
variable.StatusCode = StatusCodes.Good;
variable.Timestamp = DateTime.UtcNow;
if (opcUaServer != null)
{
AddPredefinedNode(SystemContext, variable);
}
if(FindNodeInAddressSpace(variable.NodeId) != null){
Console.WriteLine("Node succesfully created");
return ServiceResult.Good;
}
return new ServiceResult(2);
}