# Flow Optimization

**URL:** <https://discourse.nodered.org/t/flow-optimization/58821>\
**Category:** General\
**Created:** [22 February 2022 14:55 UTC](https://discourse.nodered.org/t/flow-optimization/58821 "2022-02-22T14:55:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aallen](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@aallen](https://discourse.nodered.org/u/aallen)\
**Post date:** [22 February 2022 14:55 UTC](https://discourse.nodered.org/t/flow-optimization/58821/1 "2022-02-22T14:55:41Z")

</div>

Hello, I am trying to get some tips on how I could optimize my flow. I frequently get modbus errors and I suspect it is due to the layout of my flows.

 ![Screen Shot 2022-02-22 at 8.50.02 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a52ccc49fb74c8f7f2b7e95854aa8b882335a1cd.png)  
 ![Screen Shot 2022-02-22 at 8.50.39 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2e9fe4d80db2f444aa9675e8e39d5f94fc639875.png)  
All the 'link outs' are going to a mosquito broker.  
Here are the modbus errors I receive:

```auto
2/8/2022, 4:30:57 PMnode: VFD MODBUS
msg : string[123]
"Client -> fsm failed state after sending Get More About It By Logging Serial@/dev/ttySerMod0.0:9600bit/s default Unit-Id: 1"

2/8/2022, 4:31:42 PMnode: VFD MODBUS
msg : string[122]
"Client -> fsm broken state after failed Get More About It By Logging Serial@/dev/ttySerMod0.0:9600bit/s default Unit-Id: 1"

2/8/2022, 4:31:42 PMnode: VFD MODBUS
msg : string[125]
"Client -> fsm reconnect state after broken Get More About It By Logging Serial@/dev/ttySerMod0.0:9600bit/s default Unit-Id: 1"

2/8/2022, 4:31:44 PMnode: VFD MODBUS
msg : string[97]
"Client -> fsm init state after reconnecting Serial@/dev/ttySerMod0.0:9600bit/s default Unit-Id: 1"

2/8/2022, 4:24:49 PM node: VFD MODBUS
msg : string[83]
"Client -> fsm init in 2000 ms Serial@/dev/ttySerMod0.0:9600bit/s default Unit-Id: 1"

2/8/2022, 4:31:46 PMnode: VFD MODBUS
msg : string[125]
"Client -> fsm connected after state opened Get More About It By Logging Serial@/dev/ttySerMod0.0:9600bit/s default Unit-Id: 1"

```

This errors occurs with various MODBUS nodes, including the nodes shown in the screenshots.

Here is one of the flows I showed a screenshot of: (It was too many characters for the plaintext)

```auto
https://github.com/AustinEcowerks/Node-Red/blob/main/Flow

```

---

<div class="post-metadata">

**Author:** ![StrongTown](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@StrongTown](https://discourse.nodered.org/u/StrongTown)\
**Post date:** [22 February 2022 15:32 UTC](https://discourse.nodered.org/t/flow-optimization/58821/2 "2022-02-22T15:32:20Z")

</div>

I haven't looked at any of your code (as yet) and I'm not very good with modbus (fought my own battle getting mine working) however I did run into a problem you might start with. How many connections are you making to your modbus device and how many does it support?

---

<div class="post-metadata">

**Author:** ![aallen](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@aallen](https://discourse.nodered.org/u/aallen)\
**Post date:** [22 February 2022 15:45 UTC](https://discourse.nodered.org/t/flow-optimization/58821/3 "2022-02-22T15:45:00Z")

</div>

I'm pretty new to all of this, I've only been exposed to it for 2ish months. How can I check that?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 February 2022 15:54 UTC](https://discourse.nodered.org/t/flow-optimization/58821/4 "2022-02-22T15:54:13Z")

</div>

Hi, to avoid issues with modbus it is wise not to ask for data from different addresses/units in quick consession. e.g. break up your requests so that you dont call "MB Poll" while it is busy doing another request.

This is how I would approach it...

- Use the Link Call and a delay set to rate limit. This will minimise impact on serial port. Also, by wiring in series via the call node, you will only ever process one serial request at a time

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b2d4c0d3847f7c4caf844cca924db5e6e176e7e.png)

Here is a less drastic version...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15fcdb07697b8c94de2921b51ab717ee14a47c91.png)

---

<div class="post-metadata">

**Author:** ![aallen](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@aallen](https://discourse.nodered.org/u/aallen)\
**Post date:** [22 February 2022 19:23 UTC](https://discourse.nodered.org/t/flow-optimization/58821/5 "2022-02-22T19:23:37Z")

</div>

What palette is the "Poll" node included in? And also the "Link Call"

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 February 2022 20:05 UTC](https://discourse.nodered.org/t/flow-optimization/58821/6 "2022-02-22T20:05:13Z")

</div>

The "poll" node is the link call node. It is built in to node-red as of v2.1 (or maybe v.2.0, I forget)

What version of node-red are you using?

---

<div class="post-metadata">

**Author:** ![aallen](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@aallen](https://discourse.nodered.org/u/aallen)\
**Post date:** [22 February 2022 21:15 UTC](https://discourse.nodered.org/t/flow-optimization/58821/7 "2022-02-22T21:15:06Z")

</div>

1.0.3, I have to update the firmware of the groov EPIC PLC in order to update node-red, if I understand correctly. I haven't gotten the sign off to be able to shut down and update the firmware yet.

---

<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:** [23 April 2022 21:15 UTC](https://discourse.nodered.org/t/flow-optimization/58821/8 "2022-04-23T21:15:45Z")

</div>

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