Troubleshooting
Node-RED OPC UA subscription stops reflecting PLC changes
Short answer
Alternating 'Active subscribing' and 'keep-alive' status does not prove the OPC UA session died. A Join node set to count 9 holds output until nine messages arrive, and an RBE node suppresses an unchanged payload, so either can hide live PLC updates. Add Debug nodes at the client output, the Join output and the RBE output, stop the 1-second subscribe Inject, and read which node stops.

On this page
- Why does the OPC UA client flip between Active subscribing and keep-alive?
- Where do the Debug nodes go to find the node that hides PLC updates?
- Why does a Join node with count 9 hold back all nine PLC values?
- Why does the RBE node swallow a PLC change you just made?
- Should the subscribe Inject repeat every second?
- What does the deadband do to small PLC value changes?
- When is it the OPC UA session rather than the flow?
- What proves the subscription path is fixed?
- Questions asked
A Node-RED flow that reads a PLC over OPC UA can keep alternating between 'Active subscribing' and 'keep-alive' and still be connected, because those status texts describe the subscription, not your data path. When PLC changes stop reaching the Debug window, the usual cause sits between the client and the window: a Join node that waits for nine messages before it emits, an RBE node that suppresses an unchanged payload, or a subscribe Inject that repeats every second. Debug the client output, the Join output and the RBE output; the first node whose output stops is the one hiding the data. Every number below comes from one reference flow: nine NodeIds in namespace 3, an OpcUa-Client in subscribe action at a 100 ms interval, deadband type a with value 1, a Join at count 9 and a 1-second Inject, reading a TIA Portal V16 project on PLCSIM Advanced V2.0.
Why does the OPC UA client flip between Active subscribing and keep-alive? #
The flip is normal and does not prove a fault: OPC UA Part 4 defines the keep-alive as the message a subscription sends to tell the client it is still active whenever a publish cycle has no value change to report.
Alternating texts therefore show the opposite of a dead link: the client keeps sending publish requests and the server keeps answering them. A keep-alive turn means a publish cycle passed without a reportable change; an Active subscribing turn means notifications or further exchanges are under way. Neither text says anything about the Join, the RBE or the function that builds the record, because status lives on the client node while your data path lives after it. Read the status as proof of a live subscription and judge the flow by counting messages at the node outputs, never by the words on the client node.
Where do the Debug nodes go to find the node that hides PLC updates? #
Wire three temporary Debug nodes, one directly on the OpcUa-Client output, one on the Join output and one on the RBE output, then change one PLC value and read which Debug stays silent, because the first silent node is the one hiding your data.
Set each Debug to show the complete message rather than the payload alone, so you can see the topic string, the value object and any status the client attaches; payload-only display hides exactly the fields the value-extraction function depends on. Then walk this decision path:
- Client Debug silent on a changed PLC value: suspect the subscription, its monitored items, the deadband or the server side; the deadband and session sections below take over from here.
- Client Debug live, Join Debug silent: the Join has not collected its nine parts; count how many distinct topics ever reach the client Debug.
- Join Debug live, RBE Debug silent: the assembled object equals the previous one, and report-by-exception is doing exactly what it was configured to do.
- RBE Debug live, final Debug silent: the value-extraction function or the formatting function is dropping the message, usually because a field it tests is absent from the captured message.
Change one variable at a time for these checks; simultaneous changes blur the count.
Why does a Join node with count 9 hold back all nine PLC values? #
In custom mode building an object keyed by msg.topic, the Join emits nothing until it has collected exactly nine parts, so a single NodeId that never changes keeps all nine PLC values out of the Debug window indefinitely.
A subscription reports only values that change, so a tag that sits still never feeds the Join, and a count-based object join has no partial output. Eight topics that change and one that never does leave you eight parts short forever, and the hold-up hides every value you did change. Two fixes exist. First, confirm each of the nine identifiers against the address space the server actually exposes, for example ns=3;s="SQL"."H_AWGrm/Mtr" with its slash, spelled exactly as the server shows it. Second, enable the Join's timeout option so a set missing one part still flushes instead of stalling the record indefinitely. After the fix, a completed set should clear the buffer and let the next nine parts assemble fresh.
Why does the RBE node swallow a PLC change you just made? #
With report-by-exception set on the complete payload and separate topics disabled, the RBE compares the assembled nine-field object with the previous one and drops it whenever every field matches, even when the PLC value moved away and back between two assemblies.
Report-by-exception exists to suppress repeats, and on the assembled object it judges the whole record, not the one value you changed. The classic miss: a bit pulses on and off, or a counter returns to its previous reading before the next nine parts assemble, so the new object equals the old one and the RBE discards the change you just made. While commissioning, bypass the RBE so every record reaches the Debug window. Keep it in production only when suppressing a complete record whose values all repeat is the logging behavior you intend.
Should the subscribe Inject repeat every second? #
No, set the Inject that triggers the multiple subscription to fire once after deploy, because a fresh subscription request every second re-arms monitored items and turns the diagnosis of client notifications into a test of your own Inject timing.
In subscribe action the client expects a topic of multiple and a payload array of the NodeIds to watch; every firing sends that request again, interleaving it with value notifications and resetting the monitored-item setup you are trying to observe. With the request repeating continuously, the client Debug fills with the artifacts of your own trigger and a genuine notification becomes hard to tell from re-subscription noise. Fire it once, then judge the client Debug purely on notifications.
Subscription mode reports changes on its own, while the read action polls on demand; how Node-RED reads PLC data: OPC UA, MQTT or Modbus compares the three ways of getting PLC data into Node-RED and when each fits. For the timing argument in favor of change-driven subscription, why OPC UA subscription updates beat polling PLC input changes works through the sampling arithmetic.
What does the deadband do to small PLC value changes? #
The deadband in this client, set to type a with value 1, makes the server suppress notifications for changes smaller than that threshold, so a variable creeping by fractions of a unit produces no message at all while larger steps still arrive.
The server applies the deadband to each monitored item, upstream of everything in your flow, so no Debug node after the client can ever show a change it removed. Before you interpret the threshold, check what the type letter selects in your installed node version, because that meaning belongs to the node's implementation. Then clear it for the test: set the deadband to zero, step one variable, and watch the client Debug.
Worked example from the reference flow: a value stepping by 5 passes a threshold of 1, because 5 is greater than 1; a value creeping by 0.2 per scan never notifies, because 0.2 is less than 1; a counter incrementing by exactly 1 sits on the comparison boundary, so test it rather than assume. Give each step a few multiples of the requested 100 ms interval before you call the Debug silent. If the small step appears once the deadband is cleared, the deadband was the filter, and the fix is a threshold your logging can accept, not a rewritten flow.
When is it the OPC UA session rather than the flow? #
Call it a session or server problem only when the client Debug itself stays silent with the deadband cleared, the Inject firing once and every NodeId confirmed, for example after the PLC simulator or the OPC UA server restarts and notifications never resume.
A session fault has a signature the flow faults do not: the client Debug goes quiet at the same moment the status settles, with nothing queued behind it and no content anywhere downstream. With this node family, one reported behavior is that a subscription is not continued after the server goes down and comes back, and the options for holding the session open, such as keepSessionAlive, differ between versions, so read the settings of the version you have installed instead of assuming automatic recovery.
The 2-to-3-minute stall reported with this symptom is an observation, not a timeout you can configure, so do not go looking for one. Capture the complete client messages and status transitions from just before and just after the stop, because those records separate a monitored-item problem from a lost session. The same reconnection discipline governs other subscriber links: why an MQTT subscriber stops receiving after a broker restart covers the broker-side twin of this failure.
What proves the subscription path is fixed? #
Declare the path working only when this four-step proof passes: a controlled change to each of the nine PLC values produces a message at the client Debug, the Join emits one object with nine keys, and the formatting function outputs all nine named fields.
Run it in order and record each result:
- Change each of the nine PLC values in turn and confirm one client Debug message per change, with the matching topic string.
- Confirm the Join emits one object carrying all nine topic keys.
- Confirm the formatting function outputs every named field, including the bit field mapped to 1 or 0.
- Write one value back unchanged and confirm the RBE suppression matches the logging behavior you intend; while commissioning, leave the RBE out of the path.
Change PLC values for these tests only on a simulator or with the operations team's agreement, because writing test values to a running line is a process change, not a debugging step.
The decision, case by case: a silent client Debug means clear the deadband, verify the identifiers, and only then call the session or the server the fault; a live client with a silent Join means a missing or misspelled identifier is starving the count, so fix the identifier or enable the Join timeout; a live Join with a silent RBE means suppression is working as configured, so bypass it while commissioning; an RBE output with a silent final Debug means the extraction or formatting function is eating the message, so capture the full message and re-check its structure. A flow that passes all four steps keeps reflecting PLC changes regardless of what the status text does.
Questions asked
Can a value-extraction function drop a valid OPC UA message?
Yes. A function that returns a message only when msg.payload and msg.payload.value exist passes nothing downstream when the client reports a status-only message or a changed structure, and a function with no return path at all stays silent. Capture the complete client message during the fault and confirm the fields your function reads are still where they were when the flow first worked.
How do I verify the exact NodeIds my subscription uses?
Browse the server address space with a dedicated OPC UA client or the node's own browse function and compare each identifier character by character rather than reading it back from your flow. The nine identifiers here are quoted strings under namespace 3, and the one containing a slash must match the server's spelling exactly, because the Join keys the assembled object by the topic string you sent.
Why does my subscription not come back after the PLC simulator restarts?
A server that goes down and comes back does not always have its subscriptions rebuilt by the client on its own; with this node family, a reported behavior is that the subscription is not continued after downtime. Check whether your installed version offers a session keep-alive option such as keepSessionAlive, and add a deliberate re-subscribe trigger that fires when the endpoint returns, so a restarted simulator does not leave the flow deaf until you redeploy.
Does the same diagnosis apply to the other OPC UA node sets in the palette?
The decision path does: client output first, then any assembly step, then any change filter. The names of the nodes and their settings differ between the node sets, and reconnect behavior is specific to each package and version, so read the settings of the nodes you actually have installed before applying any fix from this article.
Where should change filtering sit if the log needs every changed value?
In front of the Join, applied to each value on its own. Report-by-exception per value passes any changed value onward and lets the Join rebuild the record, while report-by-exception on the assembled object suppresses the whole record when the unchanged fields outnumber the one that changed. While commissioning, leave all change filtering out of the path.
