Skip to content

Commit

Permalink
on node export only output TypeId for vars/objects (#1574)
Browse files Browse the repository at this point in the history
only output the DataTypeDefinitionId and ReferenceTypeId vor var/objects
fixes nodeset output of #1532 
fixes OPCFoundation/UA-ModelCompiler#94
  • Loading branch information
opcfoundation-org committed Nov 2, 2021
1 parent 2374155 commit 0915063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Stack/Opc.Ua.Core/Stack/State/BaseInstanceState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ protected override void Export(ISystemContext context, Node node)
node.ReferenceTable.Add(referenceTypeId, true, this.Parent.NodeId);
}

if (!NodeId.IsNull(this.TypeDefinitionId))
if (!NodeId.IsNull(this.TypeDefinitionId) && (NodeClass == NodeClass.Object || NodeClass == NodeClass.Variable))
{
node.ReferenceTable.Add(ReferenceTypeIds.HasTypeDefinition, false, this.TypeDefinitionId);
}
Expand All @@ -556,7 +556,7 @@ public override void Save(ISystemContext context, XmlEncoder encoder)
encoder.WriteNodeId("ReferenceTypeId", m_referenceTypeId);
}

if (!NodeId.IsNull(m_typeDefinitionId))
if (!NodeId.IsNull(m_typeDefinitionId) && (NodeClass == NodeClass.Object || NodeClass == NodeClass.Variable))
{
encoder.WriteNodeId("TypeDefinitionId", m_typeDefinitionId);
}
Expand Down

0 comments on commit 0915063

Please sign in to comment.