Skip to content

Server

Server is a global table which provides functions to interact with the OPC-UA server.

Functions

Server.addObjectNode(node)

Used to add an ObjectNode to the server

Params

  • node

Returns: bool indicating the success of the operation

Server.addVariableNode(node)

Used to add a VariableNode to the server

Params

Returns: bool indicating the success of the operation

Server.addObjectTypeNode(node)

Used to add an ObjectTypeNode to the server

Params

Returns: bool indicating the success of the operation

Server.addMethodNode(node)

Used to add a MethodNode to the server

Params

  • node

Returns: bool indicating the success of the operation

Server.addNamespace(namespace_name)

Add a new namespace to the server

Params

  • namespace_name
    • string
    • The name of the namespace to create

Returns: number index of the new namespace

Server.triggerEvent(event_type_node, event_origin_node, severity, event_msg, event_src)

Triggers an event on the server

Params

  • event_type_node
    • ObjectTypeNode
    • The type of the event for which an event should be created
  • event_origin_node
    • Node
    • The node for which the event will originate from
  • severity
    • number
    • The severity of the event. Indicates the urgency in a range of 1-1000, where 1 is the lowest severity and 1000 is the highest.
  • event_msg
    • string
    • A description of the event
  • event_src
    • string
    • A description about the source of the event

Returns: bool indicating the success of the operation

Server.callMethodNode(method_node, inputs)

Used to call a MethodNode's Method

Params

  • method_node
    • MethodNode - Method node to call
  • inputs
    • Variant[] - Variants to be used as the inputs for the method

Returns: Variant[] The output(s) of the method