Skip to content

Variable Node

OPC-UA Variable Node implementation. Derived from Node.

Functions

VariableNode.new(node_id, node_name, namespace, parent_node, value, type, access_level)

Creates a new VariableNode instance

Params

  • node_id
    • NodeId
    • The NodeId of the variable node
  • node_name
    • string
    • Name of the new node
  • namespace

    • number
    • Namespace of the new node

    Note

    If not using default namespaces, then the namespace must be created with Server.addNamespace()

  • parent_node

    • NodeId
    • The NodeId of the parent node
  • value
    • string|number|boolean
    • The value of the new node
  • type
    • DataType
    • The OPC-UA type of the above value
  • access_level
    • number
    • Indicates how the value can be accessed. See AccessLevel for more information

Returns: VariableNode new instance

VariableNode.newString(node_name, namespace, parent_node, value, type, access_level)

Creates a new VariableNode instance with a String NodeId which uses node_name as it's identifier.

Params

  • node_name
    • string
    • Name of the new node
  • namespace

    • number
    • Namespace of the new node

    Note

    If not using default namespaces, then the namespace must be created with Server.addNamespace()

  • parent_node

    • NodeId
    • The NodeId of the parent node
  • value
    • string|number|boolean
    • The value of the new node
  • type
    • DataType
    • The OPC-UA type of the above value
  • access_level
    • number
    • Indicates how the value can be accessed. See AccessLevel for more information

Returns: VariableNode new instance

VariableNode.newNumeric(identifier, node_name, namespace, parent_node, value, type, access_level)

Creates a new VariableNode instance with a Numeric NodeId.

Params

  • identifier
    • number
    • The Numeric NodeId's identifier
  • node_name
    • string
    • Name of the new node
  • namespace

    • number
    • Namespace of the new node.

    Note

    If not using default namespaces, then the namespace must be created with Server.addNamespace()

  • parent_node

    • NodeId
    • The NodeId of the parent node
  • value
    • string|number|boolean
    • The value of the new node
  • type
    • DataType
    • The OPC-UA type of the above value
  • access_level
    • number
    • Indicates how the value can be accessed. See AccessLevel for more information

Returns: VariableNode new instance

VariableNode.newGUID(guid_identifier, node_name, namespace, parent_node, value, type, access_level)

Creates a new VariableNode instance with a GUID NodeId.

Params

  • guid_identifier
    • string
    • GUID identifier string - see OPC-UA GUID for more information on the structure.
  • node_name
    • string
    • Name of the new node
  • namespace

    • number
    • Namespace of the new node.

    Note

    If not using default namespaces, then the namespace must be created with Server.addNamespace()

  • parent_node

    • NodeId
    • The NodeId of the parent node
  • value
    • string|number|boolean
    • The value of the new node
  • type
    • DataType
    • The OPC-UA type of the above value
  • access_level
    • number
    • Indicates how the value can be accessed. See AccessLevel for more information

Returns: VariableNode new instance

VariableNode.newBytestring(bytestring_identifier, node_name, namespace, parent_node, value, type, access_level)

Creates a new VariableNode instance with a ByteString NodeId.

Params

  • bytestring_identifier
    • string
    • The ByteString identifier - see OPC-UA ByteString for more information on bytestrings
  • node_name
    • string
    • Name of the new node
  • namespace

    • number
    • Namespace of the new node

    Note

    If not using default namespaces, then the namespace must be created with Server.addNamespace()

  • parent_node

    • NodeId
    • The NodeId of the parent node
  • value
    • string|number|boolean
    • The value of the new node
  • type
    • DataType
    • The OPC-UA type of the above value
  • access_level
    • number
    • Indicates how the value can be accessed See AccessLevel for more information

Returns: VariableNode new instance

Methods

VariableNode:updateValue(new_value)

Updates the nodes value

Params

  • new_value
    • string|number|boolean
    • The new value, the type of this should match the DataType of the node

Returns: boolean indicates the success of updating the value

VariableNode:getValue()

Gets the value of the node

Returns: string|number|boolean value of the node

Back to top