# Modbus-Read works the first time, then stops working

**URL:** <https://discourse.nodered.org/t/modbus-read-works-the-first-time-then-stops-working/54427>\
**Category:** General\
**Tags:** modbus\
**Created:** [29 November 2021 01:56 UTC](https://discourse.nodered.org/t/modbus-read-works-the-first-time-then-stops-working/54427 "2021-11-29T01:56:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [16 January 2022 05:13 UTC](https://discourse.nodered.org/t/modbus-read-works-the-first-time-then-stops-working/54427/2 "2022-01-16T05:13:06Z")

</div>

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.

 ![NR-modbus TCP Read](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/0/20afff73566ee4157aac5ec63bc1d2f175a76e2e.jpeg)

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

 ![NR - restart flow in case of modbus error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/9468b8dd86855a6d2b0e627f18037e33124c04b0.jpeg)

> [@How to restart flows automatically?](https://discourse.nodered.org/t/how-to-restart-flows-automatically/12993):
>
> Dear all, We're encountering a situation whereby if we have loss of connectivity, a number of flows (namely websocket nodes) fail to reconnect, while I realise we could check the source for the problematic nodes and implement a reconnect mechanism, this isn't viable for number of nodes we use (longterm, yes). Is there a way to restart flows from within Node Red? This would not only be useful to overcome the above, but also for testing purposes... Failing that we're considering triggering a scr…

---

_[View the full topic](https://discourse.nodered.org/t/modbus-read-works-the-first-time-then-stops-working/54427)._
