Modbus-Read works the first time, then stops working

I have a flow with multiple modbus-read nodes that works the first time it executes, and then every node seems to stay connected (status says connected). They are set to execute every 1 minute. When it executes a second time, it gives me an PortNotOpenError error. I searched this forum and found several questions about this error, but none of them have a solution.


image

Some more info. This is getting info from a Midnite Classic 150 charge controller (solar).

I struggled a lot with modbus devices (plc's).
I'm mostly a beginner here, so my idea is just an idea. It worked for me, that's it.

I had several disconnections for unknown reasons too.

Instead of polling different adresses, I changed the way my poll works. I now poll an array of contiguous data and parse them. And I poll more often to avoid disconnections or errors and keep a steady flow.

I also added a status analyzer linked to a switch to restart the flow in case of errors.