# How to catch Modbus TCP socket errors in a flow?

**URL:** <https://discourse.nodered.org/t/how-to-catch-modbus-tcp-socket-errors-in-a-flow/23728>\
**Category:** General\
**Created:** [27 March 2020 11:33 UTC](https://discourse.nodered.org/t/how-to-catch-modbus-tcp-socket-errors-in-a-flow/23728 "2020-03-27T11:33:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZeRico](https://avatars.discourse-cdn.com/v4/letter/z/46a35a/32.png) [@ZeRico](https://discourse.nodered.org/u/ZeRico)\
**Post date:** [27 March 2020 11:33 UTC](https://discourse.nodered.org/t/how-to-catch-modbus-tcp-socket-errors-in-a-flow/23728/1 "2020-03-27T11:33:29Z")

</div>

hi,  
I'm using a simple Modbus TCP read node connecting to a remote Modbus server (outside of node-red).  
when this server is offline I receive in the debug console : "socket error: Error: connect ETIMEDOUT xxx.xxx.xxx.xxx:502" with the name of the Modbus server ( that is completely normal) .

I thought that by putting a catch node to detect these errors on this Modbus TCP read node I would be able to catch them but nothing is raised.

So how can I detect that the Modbus server is Offline ?  
thanks in advance

cheers

---

<div class="post-metadata">

**Author:** ![Folgore](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@Folgore](https://discourse.nodered.org/u/Folgore)\
**Post date:** [27 March 2020 23:29 UTC](https://discourse.nodered.org/t/how-to-catch-modbus-tcp-socket-errors-in-a-flow/23728/2 "2020-03-27T23:29:22Z")

</div>

Hi, if you use a status node, you receive the node error. After you decide what you want.  
Alternative, ping node (if is possible).

---

<div class="post-metadata">

**Author:** ![ZeRico](https://avatars.discourse-cdn.com/v4/letter/z/46a35a/32.png) [@ZeRico](https://discourse.nodered.org/u/ZeRico)\
**Post date:** [31 March 2020 09:41 UTC](https://discourse.nodered.org/t/how-to-catch-modbus-tcp-socket-errors-in-a-flow/23728/3 "2020-03-31T09:41:13Z")

</div>

Hi Folgore,  
thanks for pointing me in this direction 🙂  
ping works fine, yet node status is not giving expected results; actually, not always sending the watched node status (this modbus tcpread node)

thanks again for helping me  
cheers

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 March 2020 10:03 UTC](https://discourse.nodered.org/t/how-to-catch-modbus-tcp-socket-errors-in-a-flow/23728/4 "2020-03-31T10:03:50Z")

</div>

if there is an error the catch node should catch it - the status node shadows the status that appears under nodes (which may also show errors - but may not)

---

<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:** [30 May 2020 10:15 UTC](https://discourse.nodered.org/t/how-to-catch-modbus-tcp-socket-errors-in-a-flow/23728/5 "2020-05-30T10:15:02Z")

</div>

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