Modbus Flex Getter freezes flow when IP becomes invalid

Hi everyone,

I have node-red running at a factory. The flow uses four Modbus Flex Getter nodes to collect data from four different PLC's, each with it's own IP address that are mounted on industrial ovens.
Everything works great until someone at the factory turns off one of the PLC's. When that happens the entire flow "freezes". I believe this happens because the IP address listed in the Flex Getter node is suddenly no longer available. Node-red also does not automatically reconnect when the IP address becomes valid again, I have to press F5 on the keyboard to "unfreeze" the flow.

Here is the flow for oven 1.

Does anyone know of a fix or a work around to prevent node-red from freezing up when an IP is no longer valid? Maybe some sort of other node in front of the Flex Getter node?

node.js version 14.7.0
Node-red version 2.2.2
node-red-contrib-modbus version 5.23.3

Thank you,
Jay

1 Like

What do you mean by freezing? Do you mean that the browser is hung up or do you mean the flows stop? If the latter then how do you know that?

How are the other getter nodes connected?

Hitting F5 just refreshes the browser view, it will not have any effect on what is going on in node-red itself.

I'm running a very similar production type environment over MODBUS. I've quit using the flex-getter node in favor of using a sequencer node as you can setup the sequence of retrievals in the node itself and just trigger it with a timed injection node. That's helped things a little by itself because it's all managed by the node set and not me.

Also, Colin makes a really good question. What do you mean by freezing? I can unplug any of my MODBUS units from the network and all that happens is data goes silent for that span of time. When I plug it back in, it picks right back up and data begins streaming with no intervention on my part. The same should happen with your setup. The MODBUS node set is very robust in my opinion and it's only when I myself setup something incorrectly that I broke its functionality. It should be that when you start a new MODBUS query, it re-establishes any lost connections and goes.

One thing I have to also wonder about is if there's something in your setup that's hanging due to the lack of response. It's obvious there's only part of a flow there, so there could be more that is affected. I see two functions, but don't know what comes after. A question I do have, is there some reason the contents of both functions can't be housed in one? I'm not saying your problem is there, but I don't know. If there's something in one of those functions relying on a specific input that it's not getting (i.e. your MODBUS node outputs an error), it could cause an error in that function that doesn't recover. Not likely, but also not impossible.

One final thought is that perhaps your PLC is using DHCP for the IP address and it gets a new one when it's powered back on. This could cause the flow to lockup because it doesn't have the correct address. Though I don't know why it would pick back up when refreshing your browser.

Since it's commercial, I get you may not be able to show your whole flow. But anything more you can share will be helpful to getting this solved. And if you can export even one of the flows from beginning to end (i.e. the oven flow), that would be helpful too as we would be able to see not only the connections, but the internals you have setup as well.