NVL from CODESYS to Node-Red delay

Node-Red has been a really powerful tool for me and I can only imagine how much harder some of my tasks would be without it. I use the NVL function to exchange data between my Node-Red flows and my CODESYS application.

That being said, I have noticed the same issue in multiple projects and I think I have something misconfigured: There is a noticeable lag from a VAR in CODESYS changing until it updates to Node-Red. The debug window will be empty. Other times this doesn’t happen and the debug window floods with updates.
Data coming from Node-Red into CODESYS is perfect.

This has happened to me on project with both PFC200 and CC100.

On the CODESYS side I have the NVL list set up to pack variables and CyclicTransmission Interval 50ms, in its own task that also runs at a 50ms cyclic interval.

PFC200 and CC100 both have 1 processor, so tasks like runtime (high priority) or nodered (low priority) have to be call one by one. If you set runtime tasks with high priority and also low timing the system scheduler will prioritize runtime, so nodered can be even choked.

What can you do?
Use htop command with console:
Download PuTTY ( Download PuTTY - a free SSH and telnet client for Windows) it is a SSH client, so we can connect do PLC console via SSH

How to change htop configuration to see task names:

and check if Load average is near 1-2, if not, change codesys tasks time or change 751-9412 CC100 (2 threaded processor) or PFC300 (4 threads)

Task priority advice:

1 Like