Hi Madhouse,
Thank you for your detailed answer and trying to help me fix this problem, I really appreciate it. This project really is important for us as it’s our first professional installation using node-red and I admit that I am no expert at node-red programming, although I've been a professional coder for over twenty-five years.
I'll also say that this problem had me pulling my hair out.
I looked into all of your suggestions in detail, and you gave me some really constructive ideas.
You are correct, this is an industrial installation, but it is a pretty generic oven configuration so there’s no reason as to why I can’t share the hardware configuration as it is at the factory, where the PLC’s are Allen Bradley Micro 870’s and the HMI Touchscreens are also Allen Bradley Panelview 800’s.
Here's an image of the overall process, along with partial IP addresses.
All four ovens have the same flow and the same code in their respective
Function nodes.
I solved this issue by doing two things.
Oven 1 used an Inject node to start the flow, but Ovens 2, 3 and 4 used a Complete node to execute their flows once the previous oven had completed its flow - changing the Complete nodes to Inject nodes on all four ovens with a one second off-set solved the problem of node-red pausing (or freezing, as I originally referred to it) when a PLC was turned off.
Also, to provide more information, when a network cable was removed the node-red flow paused, and yes, it did resume when the cable was plugged back in, but, when a PLC lost its power, as if in a real power outage, the flow didn't restart automatically.
That's working now because one oven isn't waiting on another oven to complete its flow through a Complete node. Lesson learned.
The second part of this solution was to include the following if statement in my code, under the Process node.
if (typeof msg.payload.buffer != 'undefined') {
// Set the Payload Buffer
}
This prevented node-red from throwing an error and allowed me to set the buffer manually when it was undefined because of an unresolvable IP address.
I have some on-site testing to do tomorrow, but as I see it, at the moment, this issue is closed.
Thanks again for your contribution and your time.
Kind regards,
JayDL