Skip to main content

Monitor

The OPC UA Monitor node enables real-time monitoring of variables on an OPC UA server. Unlike the Read node which retrieves values on demand, the Monitor node establishes subscriptions that automatically notify you when values change, making it ideal for continuous monitoring and alarm systems.

Overview

The Monitor node uses the OPC UA subscription mechanism to efficiently track data changes. You configure monitoring parameters once, and the node automatically sends messages whenever monitored values change, without requiring repeated polling.

Key Features:

  • Automatic Notifications: Receive updates when values change
  • Multiple Monitoring Modes: Single variables, arrays, JSON structures, or entire subtrees
  • Deadband Filtering: Reduce notifications by filtering insignificant changes
  • Efficient Subscriptions: Multiple monitored items share the same subscription
  • Flexible Configuration: Static or dynamic NodeId specification

Tutorials

Getting Started

Advanced Monitoring

Optimization

  • Deadband Filtering - Reduce notification frequency by filtering insignificant value changes

Quick Start

Basic Example - Monitor a Temperature Sensor:

  1. Add a Monitor node to your flow
  2. Configure the OPC UA endpoint
  3. Select a subscription
  4. Enter the NodeId (e.g., ns=1;s=Temperature)
  5. Check "Start Immediately"
  6. Deploy your flow

The node will automatically send messages when the temperature changes.

Monitoring Concepts

Subscriptions

Subscriptions are configured in the OPC UA endpoint and define:

  • Publishing Interval: How often the server sends notification batches
  • Lifetime: How long the subscription remains active
  • Priority: Relative importance for resource allocation

A single subscription can efficiently handle many monitored items.

Monitored Items

Each monitored item tracks a specific variable and has its own:

  • Sampling Interval: How often the server checks the value
  • Queue Size: How many notifications to buffer
  • Filter: Deadband or other filtering criteria

Notification Behavior

The OPC UA server only sends notifications when:

  1. The value actually changes (per OPC UA specification)
  2. The change exceeds the deadband threshold (if configured)
  3. An initial value when monitoring starts

Use Cases

Process Monitoring

Monitor critical process variables in real-time:

// Temperature, pressure, flow rate
["ns=1;s=Reactor.Temperature", "ns=1;s=Reactor.Pressure", "ns=1;s=Reactor.FlowRate"]

Equipment Status

Track equipment operational status:

{
"running": "ns=1;s=Pump1.Running",
"speed": "ns=1;s=Pump1.Speed",
"hours": "ns=1;s=Pump1.OperatingHours"
}

Alarm Detection

Monitor for alarm conditions:

// Check multiple sensors for threshold violations
if (msg.payload > 80) {
node.send({ payload: "High temperature alarm" });
}

Historical Logging

Log all value changes to a database:

// Each notification triggers a database insert
msg.topic = "INSERT INTO history VALUES (?, ?, ?)";

Configuration Parameters

Common Settings

ParameterDescriptionDefault
Start ImmediatelyBegin monitoring when flow startsUnchecked
NodeIdVariable to monitor (if Start Immediately is checked)Empty
Sample IntervalServer sampling rate in milliseconds1000
Queue SizeMaximum buffered notifications1000
Discard OldestRemove oldest when queue is fullTrue

Advanced Settings

ParameterDescriptionOptions
Deadband TypeChange filtering methodNone, Absolute, Percent
Deadband ValueThreshold for notificationsNumeric
Output TypeMessage formatValue, DataValue

Message Properties

Input Properties

Override node configuration via message properties:

{
"topic": "ns=1;s=Temperature",
"samplingInterval": 500,
"queueSize": 100,
"deadbandType": "Absolute",
"deadbandValue": 0.5,
"outputType": "DataValue"
}

Output Properties

Standard output message format:

{
"topic": "ns=1;s=Temperature",
"payload": 23.5,
"statusCode": {
"value": 0,
"description": "Good"
},
"sourceTimestamp": "2024-11-24T10:30:45.123Z",
"serverTimestamp": "2024-11-24T10:30:45.125Z"
}

Tips & Best Practices

Choose Appropriate Sampling Intervals

  • Fast processes (< 100ms): Critical control loops
  • Normal processes (100ms - 1s): Most monitoring applications
  • Slow processes (> 1s): Temperature, level, batch processes

Use Deadband Filtering

Reduce notifications by 80-95% for analog values with natural fluctuations:

{
"deadbandType": "Absolute",
"deadbandValue": 0.5 // For temperature in °C
}

Group related variables in JSON structures for better maintainability:

{
"process": {
"temperature": "ns=1;s=Temp",
"pressure": "ns=1;s=Press"
}
}

Handle Connection Issues

The Monitor node automatically reconnects and resumes monitoring after connection loss. No manual intervention required.

Monitor Resource Usage

For large numbers of monitored items:

  • Monitor Node-RED memory usage
  • Check network bandwidth
  • Review notification frequency
  • Consider splitting across multiple Monitor nodes

Troubleshooting

No Notifications Received

  1. Verify endpoint connection (green indicator)
  2. Check subscription is active
  3. Validate NodeId using Read node
  4. Ensure "Start Immediately" is checked (or inject NodeId)

Too Many Notifications

  1. Implement deadband filtering
  2. Increase sampling interval
  3. Check for server-side noise
  4. Verify appropriate variable selection

Missing Some Notifications

  1. Increase queue size
  2. Verify "Discard Oldest" setting
  3. Check network stability
  4. Review Node-RED processing speed

Memory Issues

  1. Reduce number of monitored items
  2. Increase sampling intervals
  3. Implement filtering
  4. Split into multiple Monitor nodes

Resources