View Source OpcUA.Client behaviour (Opex62541 v0.1.4)

OPC UA Client API module.

This module provides functions for configuration, read/write nodes attributes and discovery of a OPC UA Client.

OpcUA.Client is implemented as a __using__ macro so that you can put it in any module, you can initialize your Client manually (see test/client_tests) or by overwriting configuration/1 and monitored_items/1 to autoset the configuration and subscription items. It also helps you to handle Client's "subscription" events (monitorItems) by overwriting handle_subscription/2 callback.

The following example shows a module that takes its configuration from the environment (see test/client_tests/terraform_test.exs):

defmodule MyClient do
  use OpcUA.Client

  # Use the `init` function to configure your Client.
  def init({parent_pid, 103} = _user_init_state, opc_ua_client_pid) do
    %{parent_pid: parent_pid, opc_ua_client_pid: opc_ua_client_pid}
  end

  def configuration(_user_init_state), do: Application.get_env(:my_client, :configuration, [])
  def monitored_items(_user_init_state), do: Application.get_env(:my_client, :monitored_items, [])

  def handle_subscription_timeout(subscription_id, state) do
    send(state.parent_pid, {:subscription_timeout, subscription_id})
    state
  end

  def handle_deleted_subscription(subscription_id, state) do
    send(state.parent_pid, {:subscription_delete, subscription_id})
    state
  end

  def handle_monitored_data(changed_data_event, state) do
    send(state.parent_pid, {:value_changed, changed_data_event})
    state
  end

  def handle_deleted_monitored_item(subscription_id, monitored_id, state) do
    send(state.parent_pid, {:item_deleted, {subscription_id, monitored_id}})
    state
  end
end

Because it is small a GenServer, it accepts the same options for supervision to configure the child spec and passes them along to GenServer:

defmodule MyModule do
  use OpcUA.Client, restart: :transient, shutdown: 10_000
end

Summary

Callbacks

Optional callback that gets the Server configuration and discovery connection parameters.

Optional callback that handles a deleted monitored items events.

Optional callback that handles a subscriptions timeout events.

Optional callback that handles node values updates from a Client to a Server.

Optional callback that handles a subscriptions timeout events.

Functions

Adds a monitored item used to request a server for notifications of each change of value in a specific node. The following option must be filled

Sends an OPC UA Server request to start subscription (to monitored items, events, etc).

Returns a specification to start this module under a supervisor.

Connects the OPC UA Client by a url. The following must be filled

Connects the OPC UA Client by a url using a username and a password. The following must be filled

Connects the OPC UA Client by a url without a session. The following must be filled

Adds a monitored item used to request a server for notifications of each change of value in a specific node. The following option must be filled

Sends an OPC UA Server request to delete a subscription.

Disconnects the OPC UA Client.

Finds Servers Connected to a Discovery Server. The following must be filled

Finds Servers Connected to a Discovery Server. The following must be filled

Gets the OPC UA Client current Configuration.

Get endpoints from a OPC UA Server. The following must be filled

Gets the state of the OPC UA Client.

Callback implementation for GenServer.init/1.

Reads 'Access level' of a node in the server.

Reads 'array_dimensions' of a node in the server.

Reads the browse name attribute of a node in the server.

Reads 'contains_no_loops' attribute of a node in the server.

Reads 'data_type' attribute of a node in the server.

Reads description attribute of a node in the server.

Reads the display name attribute of a node in the server.

Reads 'event_notifier' attribute of a node in the server.

Reads 'Executable' attribute of a node in the server.

Reads 'Historizing' attribute of a node in the server.

Reads 'Inverse name' attribute of a node in the server.

Reads 'Is Abstract' attribute of a node in the server.

Reads 'Minimum Sampling Interval level' of a node in the server.

Reads the node_class attribute of a node in the server.

Reads the node_id attribute of a node in the server.

Reads 'Symmetric' attribute of a node in the server.

Reads 'user_access_level' attribute of a node in the server.

Reads 'user_executable' attribute of a node in the server.

Reads 'user_write_mask' attribute of a node in the server.

Reads 'value' attribute of a node in the server. Note: If the value is an array you can search a scalar using index parameter.

Reads 'Value' attribute (matching data type) of a node in the server.

Reads 'value' attribute of a node in the server. Note: If the value is an array you can search a scalar using index parameter.

Reads 'Value Rank' of a node in the server.

Reads 'Write Mask' attribute of a node in the server.

Resets the OPC UA Client.

Sets the OPC UA Client configuration.

Sets the OPC UA Client configuration with all security policies for the given certificates. The following must be filled

Starts up a OPC UA Client GenServer.

Stops a OPC UA Client GenServer.

Change 'Access level' of a node in the server.

Change 'Array Dimensions' of a node in the server.

Creates a blank 'value array' attribute of a node in the server. Note: the array must match with 'value_rank' and 'array_dimensions' attribute.

Change the browse name of a node in the server.

Change 'contains_no_loops' attribute of a node in the server.

Change 'data_type' attribute of a node in the server.

Change description attribute of a node in the server.

Change the display name attribute of a node in the server.

Change 'event_notifier' attribute of a node in the server.

Change 'Executable' attribute of a node in the server.

Change 'Historizing' attribute of a node in the server.

Change 'Inverse name' attribute of a node in the server.

Change 'Is Abstract' attribute of a node in the server.

Change 'Minimum Sampling Interval level' of a node in the server.

Change 'node_class' attribute of a node in the server. Avalable value are

Change 'node_id' attribute of a node in the server.

Change 'symmetric' attribute of a node in the server.

Change 'user_access_level' attribute of a node in the server.

Change 'user_executable' attribute of a node in the server.

Change 'user_write_mask' attribute of a node in the server.

Change 'Value' attribute of a node in the server.

Change 'Value rank' of a node in the server.

Change 'Write Mask' attribute of a node in the server.

Types

@type config_options() :: {:config, map()} | {:conn, conn_params()}
@type conn_params() ::
  {:hostname, binary()} | {:port, non_neg_integer()} | {:users, keyword()}
Link to this type

monitored_items_options()

View Source
@type monitored_items_options() ::
  {:subscription, float()}
  | {:monitored_item, %OpcUA.MonitoredItem{args: term()}}

Callbacks

@callback configuration(term()) :: config_options()

Optional callback that gets the Server configuration and discovery connection parameters.

Link to this callback

handle_deleted_monitored_item(integer, integer, term)

View Source
@callback handle_deleted_monitored_item(integer(), integer(), term()) :: term()

Optional callback that handles a deleted monitored items events.

It's first argument is the subscription_id of the subscription that the monitored item belongs to. The second element is the 'monitored_item_id' which is an unique number asigned to a monitored item when its created.

The third argument it's the GenServer state (Parent process).

Link to this callback

handle_deleted_subscription(integer, term)

View Source
@callback handle_deleted_subscription(integer(), term()) :: term()

Optional callback that handles a subscriptions timeout events.

It's first argument is the subscription_id of the subscription.

The second argument it's the GenServer state (Parent process).

Link to this callback

handle_monitored_data({}, term)

View Source
@callback handle_monitored_data({integer(), integer(), any()}, term()) :: term()

Optional callback that handles node values updates from a Client to a Server.

It's first argument is a tuple, in which its first element is the subscription_id of the subscription that the monitored item belongs to. the second element is the 'monitored_item_id' which is an unique number asigned to a monitored item when its created and the third element of the tuple is the new value of the monitored item.

the second argument it's the GenServer state (Parent process).

Link to this callback

handle_subscription_timeout(integer, term)

View Source
@callback handle_subscription_timeout(integer(), term()) :: term()

Optional callback that handles a subscriptions timeout events.

It's first argument is the subscription_id of the subscription.

The second argument it's the GenServer state (Parent process).

@callback monitored_items(term()) :: monitored_items_options()

Functions

Link to this function

add_monitored_item(pid, args)

View Source
@spec add_monitored_item(GenServer.server(), list()) ::
  {:ok, integer()} | {:error, term()} | {:error, :einval}

Adds a monitored item used to request a server for notifications of each change of value in a specific node. The following option must be filled:

  • :subscription_id -> integer().
  • :monitored_item -> %NodeId{}.
Link to this function

add_subscription(pid, publishing_interval \\ 500.0)

View Source

Sends an OPC UA Server request to start subscription (to monitored items, events, etc).

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

connect_by_url(pid, args)

View Source
@spec connect_by_url(GenServer.server(), list()) ::
  :ok | {:error, term()} | {:error, :einval}

Connects the OPC UA Client by a url. The following must be filled:

  • :url -> binary().
Link to this function

connect_by_username(pid, args)

View Source
@spec connect_by_username(GenServer.server(), list()) ::
  :ok | {:error, term()} | {:error, :einval}

Connects the OPC UA Client by a url using a username and a password. The following must be filled:

  • :url -> binary().
  • :user -> binary().
  • :password -> binary().
Link to this function

connect_no_session(pid, args)

View Source
@spec connect_no_session(GenServer.server(), list()) ::
  :ok | {:error, term()} | {:error, :einval}

Connects the OPC UA Client by a url without a session. The following must be filled:

  • :url -> binary().
Link to this function

delete_monitored_item(pid, args)

View Source
@spec delete_monitored_item(GenServer.server(), list()) ::
  :ok | {:error, term()} | {:error, :einval}

Adds a monitored item used to request a server for notifications of each change of value in a specific node. The following option must be filled:

  • :subscription_id -> integer().
  • :monitored_item_id -> integer().
Link to this function

delete_subscription(pid, subscription_id)

View Source
@spec delete_subscription(GenServer.server(), integer()) ::
  :ok | {:error, term()} | {:error, :einval}

Sends an OPC UA Server request to delete a subscription.

@spec disconnect(GenServer.server()) :: :ok | {:error, term()} | {:error, :einval}

Disconnects the OPC UA Client.

@spec find_servers(GenServer.server(), binary()) ::
  :ok | {:error, term()} | {:error, :einval}

Finds Servers Connected to a Discovery Server. The following must be filled:

  • :url -> binary().
Link to this function

find_servers_on_network(pid, url)

View Source
@spec find_servers_on_network(GenServer.server(), binary()) ::
  :ok | {:error, term()} | {:error, :einval}

Finds Servers Connected to a Discovery Server. The following must be filled:

  • :url -> binary().
@spec get_config(GenServer.server()) ::
  {:ok, map()} | {:error, term()} | {:error, :einval}

Gets the OPC UA Client current Configuration.

@spec get_endpoints(GenServer.server(), binary()) ::
  :ok | {:error, term()} | {:error, :einval}

Get endpoints from a OPC UA Server. The following must be filled:

  • :url -> binary().
@spec get_state(GenServer.server()) ::
  {:ok, binary()} | {:error, term()} | {:error, :einval}

Gets the state of the OPC UA Client.

Callback implementation for GenServer.init/1.

Link to this function

read_node_access_level(pid, node_id)

View Source
@spec read_node_access_level(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, integer()} | {:error, binary()} | {:error, :einval}

Reads 'Access level' of a node in the server.

Link to this function

read_node_array_dimensions(pid, node_id)

View Source
@spec read_node_array_dimensions(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, list()} | {:error, binary()} | {:error, :einval}

Reads 'array_dimensions' of a node in the server.

Link to this function

read_node_browse_name(pid, node_id)

View Source
@spec read_node_browse_name(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) ::
  {:ok, %OpcUA.QualifiedName{name: term(), ns_index: term()}}
  | {:error, binary()}
  | {:error, :einval}

Reads the browse name attribute of a node in the server.

Link to this function

read_node_contains_no_loops(pid, node_id)

View Source
@spec read_node_contains_no_loops(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, {binary(), binary()}} | {:error, binary()} | {:error, :einval}

Reads 'contains_no_loops' attribute of a node in the server.

Link to this function

read_node_data_type(pid, node_id)

View Source
@spec read_node_data_type(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) ::
  {:ok,
   %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()}}
  | {:error, binary()}
  | {:error, :einval}

Reads 'data_type' attribute of a node in the server.

Link to this function

read_node_description(pid, node_id)

View Source
@spec read_node_description(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, {binary(), binary()}} | {:error, binary()} | {:error, :einval}

Reads description attribute of a node in the server.

Link to this function

read_node_display_name(pid, node_id)

View Source
@spec read_node_display_name(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, {binary(), binary()}} | {:error, binary()} | {:error, :einval}

Reads the display name attribute of a node in the server.

Link to this function

read_node_event_notifier(pid, node_id)

View Source
@spec read_node_event_notifier(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, term()} | {:error, binary()} | {:error, :einval}

Reads 'event_notifier' attribute of a node in the server.

Link to this function

read_node_executable(pid, node_id)

View Source
@spec read_node_executable(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, boolean()} | {:error, binary()} | {:error, :einval}

Reads 'Executable' attribute of a node in the server.

Link to this function

read_node_historizing(pid, node_id)

View Source
@spec read_node_historizing(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, boolean()} | {:error, binary()} | {:error, :einval}

Reads 'Historizing' attribute of a node in the server.

Link to this function

read_node_inverse_name(pid, node_id)

View Source
@spec read_node_inverse_name(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, {binary(), binary()}} | {:error, binary()} | {:error, :einval}

Reads 'Inverse name' attribute of a node in the server.

Link to this function

read_node_is_abstract(pid, node_id)

View Source
@spec read_node_is_abstract(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, boolean()} | {:error, binary()} | {:error, :einval}

Reads 'Is Abstract' attribute of a node in the server.

Link to this function

read_node_minimum_sampling_interval(pid, node_id)

View Source
@spec read_node_minimum_sampling_interval(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, integer()} | {:error, binary()} | {:error, :einval}

Reads 'Minimum Sampling Interval level' of a node in the server.

Link to this function

read_node_node_class(pid, node_id)

View Source
@spec read_node_node_class(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) ::
  {:ok,
   %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()}}
  | {:error, binary()}
  | {:error, :einval}

Reads the node_class attribute of a node in the server.

Link to this function

read_node_node_id(pid, node_id)

View Source
@spec read_node_node_id(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) ::
  {:ok,
   %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()}}
  | {:error, binary()}
  | {:error, :einval}

Reads the node_id attribute of a node in the server.

Link to this function

read_node_symmetric(pid, node_id)

View Source
@spec read_node_symmetric(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, boolean()} | {:error, binary()} | {:error, :einval}

Reads 'Symmetric' attribute of a node in the server.

Link to this function

read_node_user_access_level(pid, node_id)

View Source
@spec read_node_user_access_level(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: :ok | {:error, binary()} | {:error, :einval}

Reads 'user_access_level' attribute of a node in the server.

Link to this function

read_node_user_executable(pid, node_id)

View Source
@spec read_node_user_executable(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: :ok | {:error, binary()} | {:error, :einval}

Reads 'user_executable' attribute of a node in the server.

Link to this function

read_node_user_write_mask(pid, node_id)

View Source
@spec read_node_user_write_mask(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: :ok | {:error, binary()} | {:error, :einval}

Reads 'user_write_mask' attribute of a node in the server.

Link to this function

read_node_value(pid, node_id, index \\ 0)

View Source
@spec read_node_value(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: {:ok, term()} | {:error, binary()} | {:error, :einval}

Reads 'value' attribute of a node in the server. Note: If the value is an array you can search a scalar using index parameter.

Link to this function

read_node_value_by_data_type(pid, node_id, data_type)

View Source
@spec read_node_value_by_data_type(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: {:ok, term()} | {:error, binary()} | {:error, :einval}

Reads 'Value' attribute (matching data type) of a node in the server.

Link to this function

read_node_value_by_index(pid, node_id, index \\ 0)

View Source
@spec read_node_value_by_index(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: {:ok, term()} | {:error, binary()} | {:error, :einval}

Reads 'value' attribute of a node in the server. Note: If the value is an array you can search a scalar using index parameter.

Link to this function

read_node_value_rank(pid, node_id)

View Source
@spec read_node_value_rank(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, integer()} | {:error, binary()} | {:error, :einval}

Reads 'Value Rank' of a node in the server.

Link to this function

read_node_write_mask(pid, node_id)

View Source
@spec read_node_write_mask(GenServer.server(), %OpcUA.NodeId{
  identifier: term(),
  identifier_type: term(),
  ns_index: term()
}) :: {:ok, integer()} | {:error, binary()} | {:error, :einval}

Reads 'Write Mask' attribute of a node in the server.

@spec reset(GenServer.server()) :: :ok | {:error, term()} | {:error, :einval}

Resets the OPC UA Client.

Link to this function

set_config(pid, args \\ %{})

View Source
@spec set_config(GenServer.server(), map()) ::
  :ok | {:error, term()} | {:error, :einval}

Sets the OPC UA Client configuration.

Link to this function

set_config_with_certs(pid, args)

View Source
@spec set_config_with_certs(GenServer.server(), list()) ::
  :ok | {:error, term()} | {:error, :einval}

Sets the OPC UA Client configuration with all security policies for the given certificates. The following must be filled:

* `:private_key` -> binary() or function().
* `:certificate` -> binary() or function().
* `:security_mode` -> interger().

NOTE: [none: 1, sign: 2, sign_and_encrypt: 3]

Link to this function

start_link(args \\ [], opts \\ [])

View Source
@spec start_link(term(), list()) ::
  {:ok, pid()} | {:error, term()} | {:error, :einval}

Starts up a OPC UA Client GenServer.

@spec stop(GenServer.server()) :: :ok

Stops a OPC UA Client GenServer.

Link to this function

write_node_access_level(pid, node_id, access_level)

View Source
@spec write_node_access_level(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Access level' of a node in the server.

Link to this function

write_node_array_dimensions(pid, node_id, array_dimensions)

View Source
@spec write_node_array_dimensions(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  list()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Array Dimensions' of a node in the server.

Link to this function

write_node_blank_array(pid, node_id, data_type, array_dimensions)

View Source
@spec write_node_blank_array(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer(),
  list()
) :: :ok | {:error, binary()} | {:error, :einval}

Creates a blank 'value array' attribute of a node in the server. Note: the array must match with 'value_rank' and 'array_dimensions' attribute.

Link to this function

write_node_browse_name(pid, node_id, browse_name)

View Source
@spec write_node_browse_name(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  %OpcUA.QualifiedName{name: term(), ns_index: term()}
) :: :ok | {:error, binary()} | {:error, :einval}

Change the browse name of a node in the server.

Link to this function

write_node_contains_no_loops(pid, node_id, contains_no_loops)

View Source
@spec write_node_contains_no_loops(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  boolean()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'contains_no_loops' attribute of a node in the server.

Link to this function

write_node_data_type(pid, node_id, data_type_node_id)

View Source
@spec write_node_data_type(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()}
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'data_type' attribute of a node in the server.

Link to this function

write_node_description(pid, node_id, locale, description)

View Source
@spec write_node_description(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  binary(),
  binary()
) :: :ok | {:error, binary()} | {:error, :einval}

Change description attribute of a node in the server.

Link to this function

write_node_display_name(pid, node_id, locale, name)

View Source
@spec write_node_display_name(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  binary(),
  binary()
) :: :ok | {:error, binary()} | {:error, :einval}

Change the display name attribute of a node in the server.

Link to this function

write_node_event_notifier(pid, node_id, event_notifier)

View Source
@spec write_node_event_notifier(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'event_notifier' attribute of a node in the server.

Link to this function

write_node_executable(pid, node_id, executable?)

View Source
@spec write_node_executable(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  boolean()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Executable' attribute of a node in the server.

Link to this function

write_node_historizing(pid, node_id, historizing?)

View Source
@spec write_node_historizing(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  boolean()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Historizing' attribute of a node in the server.

Link to this function

write_node_inverse_name(pid, node_id, locale, inverse_name)

View Source
@spec write_node_inverse_name(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  binary(),
  binary()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Inverse name' attribute of a node in the server.

Link to this function

write_node_is_abstract(pid, node_id, is_abstract?)

View Source
@spec write_node_is_abstract(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  boolean()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Is Abstract' attribute of a node in the server.

Link to this function

write_node_minimum_sampling_interval(pid, node_id, minimum_sampling_interval)

View Source
@spec write_node_minimum_sampling_interval(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Minimum Sampling Interval level' of a node in the server.

Link to this function

write_node_node_class(pid, node_id, node_class)

View Source
@spec write_node_node_class(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'node_class' attribute of a node in the server. Avalable value are:

UNSPECIFIED = 0,
OBJECT = 1,
VARIABLE = 2,
METHOD = 4,
OBJECTTYPE = 8,
VARIABLETYPE = 16,
REFERENCETYPE = 32,
DATATYPE = 64,
VIEW = 128,
Link to this function

write_node_node_id(pid, node_id, new_node_id)

View Source
@spec write_node_node_id(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()}
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'node_id' attribute of a node in the server.

Link to this function

write_node_symmetric(pid, node_id, symmetric)

View Source
@spec write_node_symmetric(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  boolean()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'symmetric' attribute of a node in the server.

Link to this function

write_node_user_access_level(pid, node_id, user_access_level)

View Source
@spec write_node_user_access_level(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'user_access_level' attribute of a node in the server.

Link to this function

write_node_user_executable(pid, node_id, user_executable)

View Source
@spec write_node_user_executable(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  boolean()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'user_executable' attribute of a node in the server.

Link to this function

write_node_user_write_mask(pid, node_id, user_write_mask)

View Source
@spec write_node_user_write_mask(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'user_write_mask' attribute of a node in the server.

Link to this function

write_node_value(pid, node_id, data_type, value, index \\ 0)

View Source

Change 'Value' attribute of a node in the server.

Link to this function

write_node_value_rank(pid, node_id, value_rank)

View Source
@spec write_node_value_rank(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Value rank' of a node in the server.

This attribute indicates whether the value attribute of the variable is an array and how many dimensions the array has. It may have the following values:

value_rank >= 1: the value is an array with the specified number of dimensions value_rank = 0: the value is an array with one or more dimensions value_rank = -1: the value is a scalar value_rank = -2: the value can be a scalar or an array with any number of dimensions value_rank = -3: the value can be a scalar or a one dimensional array

Link to this function

write_node_write_mask(pid, node_id, write_mask)

View Source
@spec write_node_write_mask(
  GenServer.server(),
  %OpcUA.NodeId{identifier: term(), identifier_type: term(), ns_index: term()},
  integer()
) :: :ok | {:error, binary()} | {:error, :einval}

Change 'Write Mask' attribute of a node in the server.