在 OPC UA 中创建新的 NodeId

Creating a new NodeId in OPC UA

亲爱的 Whosebugers,

如果我想在 Ns=3 和 S='Counters' 的 Eclipse Milo 的 Identifiers.java 文件中创建一个 NodeId 什么样的 init(number) 我应该有吗?

取值的return方法是:

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

这是我能解释的最好的方式,因为我自己也不确定。

提前致谢!

该文件用于属于命名空间 0 的内置 NodeId。您不应在其中定义节点。

您可以提前定义自己的 NodeId,但它们属于哪个命名空间索引的唯一答案是 "it depends"。该索引应对应于属于您将它们添加到的命名空间的 URI 的 NamespaceUri 数组中的索引...