NodeId specialization for numeric nodeIds.

interface INodeIdNumeric {
    identifierType: NUMERIC;
    namespace: number;
    value: number;
    displayText(): string;
    isEmpty(): boolean;
    toJSON(options?: {
        namespaceArray?: string[];
    }): string;
    toString(options?: {
        addressSpace?: any;
        namespaceArray?: string[];
    }): string;
}

Hierarchy (view full)

Properties

identifierType: NUMERIC
namespace: number
value: number

Methods

  • returns true if the NodeId is null or empty

    Returns boolean

  • convert nodeId to a JSON string. same as NodeId.toString

    Parameters

    • Optionaloptions: {
          namespaceArray?: string[];
      }
      • OptionalnamespaceArray?: string[]

    Returns string

  • get the string representation of the nodeID.

    Parameters

    • Optionaloptions: {
          addressSpace?: any;
          namespaceArray?: string[];
      }
      • OptionaladdressSpace?: any

        {AddressSpace}

      • OptionalnamespaceArray?: string[]

    Returns string

    by 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)"