# Restart a flow (catch) because of modbus time-out

**URL:** <https://discourse.nodered.org/t/restart-a-flow-catch-because-of-modbus-time-out/30576>\
**Category:** Industrial\
**Created:** [23 July 2020 03:08 UTC](https://discourse.nodered.org/t/restart-a-flow-catch-because-of-modbus-time-out/30576 "2020-07-23T03:08:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PPz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ppz/32/15429_2.png) [@PPz](https://discourse.nodered.org/u/PPz)\
**Post date:** [23 July 2020 03:08 UTC](https://discourse.nodered.org/t/restart-a-flow-catch-because-of-modbus-time-out/30576/1 "2020-07-23T03:08:11Z")

</div>

I have a simple flow: a modbus plc is polled (about 60 int16 values) and distributed to my Hubitat hub.  
Simples values (temperature, power) and simple functions.

However, this device within my network is probably a little bit difficult to reach. The plc is hooked to a switch and my node-red is hooked in the same network, but it seems that my network is not perfectly set.  
That means the plc is sometimes difficult to reach (timeout) and node-red generates an error.

The idea here is to restart the flow if an error is catched (in this case time-out). Ok, I know that I should rebuild my network differently to obtain better performances, but I can't do it for now (lot of devices).

I viewed a thread about restarting a flow, but I'm lost here because (newbie) I don't know where to find this way to post to the API function flows... Even worse, where should I look into ?

> [@\[Solved\] Restarting flows programmatically](https://discourse.nodered.org/t/solved-restarting-flows-programmatically/9341):
>
> Since v0.20, the deploy menu has a new Restart Flows option. Would it be possible to provide a way to invoke this programmatically from within a flow? For example, in cases where message properties have been used to override node parameters set when a node was deployed (not encouraged, I realize, but sometimes a good idea), it could be useful to be able to recover the initial state of the flow.

> [@\[Solved\] Restarting flows programmatically](https://discourse.nodered.org/t/solved-restarting-flows-programmatically/9341/2):
>
> Looks like it simply POSTs to the API function `flows`

Some guidance will be well appreciated !

 ![catch modbus error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9b544e3837355fa137698a7ca56418c9deb6be0.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 September 2020 03:08 UTC](https://discourse.nodered.org/t/restart-a-flow-catch-because-of-modbus-time-out/30576/2 "2020-09-21T03:08:16Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
