Skip to main content

read: general concepts

Let's first introduce general concepts about reading a value from an OPCUA server with the "@opcua/for-node-red" Read node.

First of all, you need to remember that the read operation will only occurs when the node receive an input message.

The value and attributes that will be read depends on a set of rules that are quite important to understand.

The node can either be configured fully by its property that you set in the node configuration, or by the input message that you inject in the node.

As a general rule, the input message will take precedence over the node configuration.

Input

The read operation is triggered when the node receive an input message.

The nodeId to read can be specified in the following ways, in priority order:

:msg.nodeId (string): the nodeId to read

or, if msg.nodeId is not defined:

:msg.topic (string): the nodeId to read

or, if msg.topic is not defined:

Summary

At a glance

reminder !

The read operation is triggered when the node receive an input message.

reminder !

If you want to make sure that the node configuration is used, you have to ensure that the input message does not contain any property that may override the 'Read' node configuration.

reminder !

You can overwrite 'Read' node configuration by injecting a message with the following properties:

  • msg.nodeId
  • msg.topic
  • msg.attributeId : 'Value', 'DataType', 'BrowseName', 'DisplayName', 'All'