.. _vnx.opc_ua.Proxy: vnx.opc_ua.Proxy ================ .. cpp:namespace:: vnx::opc_ua::Proxy Module ------ The `vnx.opc_ua.Proxy` module provides a OPC-UA proxy to connect to a OPC-UA server. It allows to call methods as well as read variables on the server. Options ------- .. cpp:member:: string address OPC-UA server url to connect to, for example ``opc.tcp://127.0.0.1:4840``. .. cpp:member:: bool block_until_connect = true If to block client requests until first sucessful connect. .. cpp:member:: bool block_until_reconnect = false If to block client requests until next sucessful reconnect, in case connection breaks down. Functions --------- UA node ids are provided via a ``pair``, where the first value is the namespace index and the second value either an integer or a string. In case a UA method returns more than one value the ``Variant`` return value will contain an array of variants, ie. ``vector``. See also :ref:`vnx.Variant`. .. cpp:function:: Variant call(string method, vector args) const Calls a global ``method`` with the given arguments and returns the result. The implicit object for this call is `UA_NS0ID_OBJECTSFOLDER`. Requires permission ``vnx.opc_ua.permission_e.CALL``. .. cpp:function:: Variant object_call(pair object, string method, vector args) const Calls a ``method`` on the ``object`` with the given arguments and returns the result. Requires permission ``vnx.opc_ua.permission_e.CALL``. .. cpp:function:: Variant read_variable(pair node) const Reads the value of a given variable ``node``. .. cpp:function:: Variant read_object_variable(pair object, string variable) const Reads the value of a given ``variable`` of the ``object``. .. cpp:function:: void write_variable(pair node, Variant value) Writes a value to the given global variable ``node``. Requires permission ``vnx.opc_ua.permission_e.WRITE``. .. cpp:function:: void write_object_variable(pair object, string variable, Variant value) Writes a value to the given ``variable`` of the ``object``. Requires permission ``vnx.opc_ua.permission_e.WRITE``. .. cpp:function:: void browse_all() Finds all available objects and variables on the server. Will be done automatically on every connect and re-connect.