construct a node Id from a type, a value and a namespace index.
Optional
identifierType: null | NodeIdTypethe nodeID type
Optional
value: string | number | Bufferthe node id value. The type of Value depends on identifierType.
Optional
namespace: numberthe index of the related namespace (optional , default value = 0 )
Static
NodeStatic
nullStatic
resolveStatic
sameconvert nodeId to a JSON string. same as NodeId.toString
Optional
options: { Optional
namespaceget the string representation of the nodeID.
Optional
options: { Optional
address{AddressSpace}
Optional
namespaceby default, toString will return the "ns=" representation
const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
console.log(nodeid.toString());
>"ns=1;i=123"
toString can also be used to make the nsu= version of the nodeid.
const namespaceArray = ["http://opcfoundation.com/UA/","http://mynamespace2"];
const nodeid = new NodeId(NodeIdType.STRING, "Hello",1);
console.log(nodeid.toString({namespaceArray}));
>"nsu=http://mynamespace;i=123"
passing an addressSpace to the toString options will decorate the nodeId with the BrowseName of the node.
const addressSpace = getAddressSpace();
const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
console.log(nodeid.toString({addressSpace}));
>"nsu=http://mynamespace;i=123 (MyBrowseName)"
This class holds a OPC-UA node identifier.
Nodes are unambiguously identified using a constructed identifier called the NodeId. Some Servers may accept alternative NodeIds in addition to the canonical NodeId represented in this Attribute.
A Server shall persist the NodeId of a Node, that is, it shall not generate new NodeIds when rebooting.