Skip to main content

creating a OPC UA connection

Introduction

This tutorial will show you how to create a connection to an OPC UA server using the OPC UA Client node.

All the @opcua/for-node-red nodes require a connection to an OPC UA server. This connection is created using the OPC UA Client node and can be access by the endpointUrl field of the OPC UA Client node.

endpoint selection box

You can either select an existing connection by using the combobox or create a new one by selecting the add new OPCUA Endpoint at the bottom of the combobox.

endpoint selection box opened

You can edit the endpoint and connection parameters by clicking on the edit button next to the Connection field: the pen icon

connection are shared between nodes

Changing the parameters affects all the nodes that use this connection.

Don't forget to redeploy your flow when you change the connection parameters

If you edit the connection parameters, you will need to redeploy your flow for the changes to take effect.

Prerequisites

  • A running instance of Node-RED with the @opcua/for-node-red package installed.

If you haven't installed it yet, follow the installation guide.

Create a connection

  • Add an OPC UA node (for instance OPC UA Read node) to your flow.
  • Double click on the node to edit it.
  • Click on the [+] button next to the "endpoint" field to create a new Endpoint and open the Endpoint editor.
  • Enter the connection parameters and click on the Save button.
  • Click on the Done button to close the Endpoint editor.
  • Click on the Done button to close the OPC UA Read node editor.
  • Click on the Deploy button to deploy the flow.
  • Click on the debug tab to see the result.