Search code examples
javaeclipseopcmilo

Creating a new NodeId in OPC UA


Dear stackoverflowers,

If I want to make a NodeId in the Identifiers.java file of Eclipse Milo with Ns=3 and S='Counters' what kind of init(number) should I have?

The return method for the value is:

 private static NodeId init(int value) {
         return new NodeId(Unsigned.ushort(0), Unsigned.uint(value));
     }

This is the best way I could explain it because I'm not sure myself.

Thanks in advance!


Solution

  • That file is for the built-in NodeIds belonging to namespace 0. You shouldn't be defining nodes in there.

    You're free to define your own NodeIds ahead of time but the only answer to which namespace index they belong to is "it depends". The index should correspond to the index in the NamespaceUri array of the URI belonging to the Namespace you add them to...