I am using a NodeRed flow to read Modbus Data from a PLC and query it to PostgreSQL and mariaDB.
There is a function which looks at a variable from the Holding Register wheter it is 0 or 1. It will only query the data if the variable is 1. My Modbus PLC extracts the data every 500ms.
My Problem is, that if there are no changes for some hours or days, I need to restart the flow or it wont be able to read out the data, even if the Modbus Node says "active".
Is there a way to restart a NodeRed Flow via a Script or in it itself?
TYVM!
The
/flowsendpoint in the Admin API (docs) supports triggering a full reload of the flow which will tear down the whole flow and start it again. (you will need to set theNode-RED-Deployment-Typetoreload)This can be triggered by the flow it's self, but may require an Admin API token if
httpAdminAuthis enabled.