02/11/2020
Hello,
I’m working for the first time with OPCUA. I want to create a structure
{Variables (NodeClass: Object; nodeId: ns=1;i=1000)
Test1 (NodeClass: Variable; nodeId: ns=1;s=Test1)
Test2 (NodeClass: Variable; nodeId: ns=1;s=Test2)
}
and to repeat it N times. Is it possible to associate the same variables but a different value of ns to another data structure? For example:
{Variables (NodeClass: Object; nodeId: ns=100;i=1000)
Test1 (NodeClass: Variable; nodeId: ns=100;s=Test1)
Test2 (NodeClass: Variable; nodeId: ns=100;s=Test2)
}
{Variables (NodeClass: Object; nodeId: ns=101;i=1000)
Test1 (NodeClass: Variable; nodeId: ns=101;s=Test1)
Test2 (NodeClass: Variable; nodeId: ns=101;s=Test2)
}
02/11/2020
Yes, I did this. But what should I do if I want to create another Object with the same instance but different namespace index?
I have added namespace URI in the XML file as shown below
<NamespaceUris>
<Uri>urn:myproject:Head1></Uri>
<Uri>urn:myproject:Head2></Uri>
<Uri>urn:myproject:NS1></Uri>
<Uri>urn:myproject:NS2></Uri>
</NamespaceUris>
and then I have inserted a different namespace for each object. As specified in Namespace Array, ns=5 corresponds to urn:myproject:Head1, instead ns=6 is the index of urn:myproject:Head2
Variables (NodeClass: Object; nodeId: ns=5;i=1000)
Test1 (NodeClass: Variable; nodeId: ns=5;s=Test1)
Test2 (NodeClass: Variable; nodeId: ns=5;s=Test2)
}
{Variables (NodeClass: Object; nodeId: ns=6;i=1000)
Test1 (NodeClass: Variable; nodeId: ns=6;s=Test1)
Test2 (NodeClass: Variable; nodeId: ns=6;s=Test2)
}
Is it correct to proceed like this? Can I edit the file and add the Uri Namespace in URN format?
1 Guest(s)