.. _OPCUA: OPC-UA Interface ================ The OPC-UA interface is provided by the :ref:`vnx.opc_ua.Server` and :ref:`vnx.opc_ua.Proxy` modules. They allow to access internal modules via OPC-UA method calls, as well as call methods on another OPC-UA server via a :ref:`LUA_script` for example. Server ------ To enable the :ref:`vnx.opc_ua.Server` set the following config option: .. code-block:: sh cd ~/pilot echo true > config/local/enable_opcua_server The server will listen on the address ``opc.tcp://0.0.0.0:4840``. By default the following options are set: .. code-block:: javascript { "export_services": [ "PilotServer", "MovechainHandler", "TaskHandler", "HybridPlanner", "GlobalPlanner", "RoadMapPlanner", "LocalPlanner", "PlatformInterface", "vnx.process" ], "export_topics": [ ... ], "use_authentication": true, "default_access": "USER" } To add more modules and topics to the interface create a config file ``config/local/OPC_UA_Server.json`` as follows: .. code-block:: javascript { "export_services+": [ "AnotherModule", ... ], "export_topics+": [ "another.topic", ... ] } Proxy ----- To run a :ref:`vnx.opc_ua.Proxy` which connects to another OPC-UA server create the following config file ``config/local/opcua_proxy_map``: .. code-block:: javascript [ ["OPC_UA_Proxy_1", "opc.tcp://127.0.0.1:4840"], ... ] The above proxy will be available unter the module name ``OPC_UA_Proxy_1``, see :ref:`LUA_script` for examples on how to use it. Data Types ---------- Primitive data types are directly mapped to their OPC-UA counter parts, such as ``int`` to ``INT32``, ``float`` to ``FLOAT``, etc. ``string`` is directly mapped to a OPC-UA ``STRING``. Arrays of said types are directly mapped to OPC-UA arrays. Anything else will be converted to JSON and transported via a ``LocalizedText`` object, with the ``locale`` set to ``JSON``.