How-to
Running PLC logic and Node-RED on one ctrlX CORE
Short answer
Yes: one ctrlX CORE runs the PLC application and the Node-RED app at the same time, with the ctrlX Data Layer as the only bridge between them. Keep every time-critical machine decision in the PLC scan; Node-RED reads the published data and serves the dashboard. Prove the chain with one internal test value at each boundary before trusting a single displayed number.

On this page
Yes. One ctrlX CORE runs the PLC application and the Node-RED app at the same time, and the ctrlX Data Layer is the bridge you commission between them. The PLC program owns every time-critical machine decision inside its scan; Node-RED reads the published values and serves the dashboard. The real work is proving the chain — PLC variable, Data Layer item, Node-RED message, displayed value — with one internal test value at each boundary, because the browser shows sampled states, not every scan. Below is the commissioning sequence, a counter test with the arithmetic, and the decision for every task you might be tempted to move between the two apps.
One controller, two apps, one bridge #
The PLC app executes the machine-control program, one scan cycle at a time. The Node-RED app is a flow-based connectivity application optimized for ctrlX CORE, integrated into the automation platform and tied to the controller's user management. Running both on one controller removes a separate application-server host — the same consolidation as running Python and Node-RED beside PLC code on an edge PC — but it does not merge the two execution models.
Keep interlocks, sequencing and anything a scan deadline owns in the PLC program; give Node-RED the data handling, forwarding and visualization. One safety rule settles that boundary for good: an interlock or E-stop path never moves into a flow, and a dashboard is presentation, never proof that control is executing.
Why the Data Layer is the bridge #
The documented route from PLC to reader is a mapping: real-time data from the PLC program is mapped into the ctrlX Data Layer Realtime area, and the manufacturer's documentation lists the available mapping options for that connection. In the controller's Data Layer window you can then access the process data of every component registered at the ctrlX OS Data Layer, whatever its data type. Read the item's path, type and current value from that live view; never assemble a path from a guessed variable name.
Inside the app, the vendor's node package node-red-contrib-ctrlx-automation supplies the Data Layer nodes, and reading a node and all its subnodes in Node-RED from the Data Layer is the same operation when you need a whole branch instead of a single item. The OPC UA Server app stays out of this path: operating that server requires a valid license, and a direct Data Layer read does not touch it.
Commission the path end to end #
- Log in at the controller's web interface from the engineering workstation. Authentication at the ctrlX CORE is also required for the Node-RED Flow Editor and the Dashboard, so this account is the one the whole chain inherits. Expected: the interface opens and lists the installed apps.
- Confirm both apps are present. The PLC app and the Node-RED app must each open; a missing app or license comes through the manufacturer's official channels, never a copy from another controller. Expected: both app interfaces load.
- Create a controlled test value in the PLC program: an internal variable plus a cycle counter that change without actuating anything. Build and deploy with your PLC engineering workflow. Expected: online monitoring shows the value stepping while the PLC runs.
- Locate the published item in the Data Layer window and note its path, data type and value from the live tree. Expected: the Data Layer value follows the monitored PLC value.
- Configure the Data Layer read in the flow against that verified path, with the connection and access rights the integration requires. Expected: the message payload carries the value with the expected type.
- Map the payload into the dashboard component for the actual value structure — a boolean, a number and a structured value each need their own handling — then deploy and open the Dashboard. Expected: the display follows the test value.
- Record the path and the mapping in the application documentation. An identifier copied from a different project can point a working connection at the wrong item.
- Break the read in a controlled test, without touching machine control. Expected: the flow marks the data unavailable or stale instead of showing an old value as current — the failure behind a Node-RED dashboard showing stale MQTT sensor values.
Prove it with a cycle counter #
Use example numbers, not device limits. Suppose the machine completes 24 cycles per minute and your verification run lasts 10 minutes. The cycle counter from step 3, incremented once per completed cycle, must then read 24 cycles/min × 10 min = 240 at every boundary: PLC monitoring 240, Data Layer 240, Node-RED payload 240, dashboard 240. Equal counts at all four boundaries prove the whole path, type and scaling included; the first boundary where the count disagrees is your fault location.
The same arithmetic settles what a screen can and cannot show. Suppose a cycle-active bit is true for 100 ms inside a display sampling period of 1000 ms: 100 ms ÷ 1000 ms = 0.1, a duty cycle of 10%. A sampled display will sometimes catch that bit and sometimes miss it, and that is sampling, not a fault — the same physics behind why a PLC misses short input pulses and how to catch them. Count the event in the PLC and display the count. Judge the path by the counter; judge the machine from the PLC, never from the dashboard.
Locate a wrong number by its boundary #
| Observed condition | Boundary to test | Expected result |
|---|---|---|
| The web interface cannot be reached | Network path and controller access | The login page loads from the engineering workstation |
| The interface works, one app will not open | App installation and license state | Both the PLC app and the Node-RED app open |
| The PLC value changes, the Data Layer value is absent or frozen | Mapping into the Data Layer | The published item follows the PLC value |
| The Data Layer value changes, the flow receives nothing | Node-RED connection and access rights | The payload follows without a connection or access error |
| The payload changes, the display stays frozen | Message handling and display configuration | The display follows the delivered value |
A working browser login proves web access only; it does not prove the flow may read a given item. Test each boundary with a two-sided reading of the same quantity — in practice, the cycle counter from the previous section read on both sides.
Where each task belongs #
- Interlocks, sequencing, motion, E-stop handling: the PLC scan. No exceptions, however convenient the flow looks.
- Publishing process data for anything off the scan: map it into the Data Layer from the PLC side, and let readers come to it.
- Dashboards, logging, forwarding to an MQTT broker or the cloud: Node-RED, under the same discipline as keeping publish and control separate in a Node-RED MQTT setup.
- Writes from the flow back to the machine: none by default. If a setpoint must originate in Node-RED, land it in a PLC variable and let the PLC validate and apply it inside its scan.
Re-run the counter test after every app update, flow change or controller replacement. A path proven at the last commissioning is not proven today.
Questions asked
Can I build the flow on a separate PC first and move it to the controller?
Yes. The vendor's Data Layer node package runs in a Node-RED app on a ctrlX CORE and also on a third-party device that runs Node-RED, so you can develop on a workstation and redeploy. Re-verify the data path on the target after the move: a path that resolved on the development setup can point elsewhere after a rename or on a different controller.
Why does the dashboard ask operators to log in?
Access to the Node-RED Flow Editor and the Dashboard requires authentication at the ctrlX CORE, because the app is tied to the controller's user management. Plan for it: give operators an account with only the rights the dashboard needs instead of sharing the engineering login, and keep that account on your access-review list with the rest of the plant.
Do I need the OPC UA Server app for Node-RED to read PLC data?
No. The direct Data Layer read does not involve it. The OPC UA Server app on the controller requires a valid license to operate, so install it only when other clients on the network need an OPC UA endpoint. Keeping Node-RED on the native Data Layer leaves you one less server to license, configure and defend.
What happens to the machine if the Node-RED app stops?
The PLC program keeps scanning, because the two apps run as separate processes; only the data path goes dark. That is exactly why the interruption test matters: without it, the dashboard keeps showing the last value as if it were current. Build the flow so a failed read is visible on screen, and never treat an operator display as proof that a machine is running.
How fast should the dashboard follow a PLC change?
As fast as your own display requirement, and never faster than you have measured. During commissioning, time-stamp a test change at the PLC and again when it appears on screen, and record the delay you observe as that path's figure. If a state can be shorter than one display refresh, stop trying to show it live: count it in the PLC and display the count.


