# Sending only on one wire

**URL:** <https://discourse.nodered.org/t/sending-only-on-one-wire/14547>\
**Category:** General\
**Created:** [20 August 2019 11:09 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547 "2019-08-20T11:09:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![petrdolejs](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@petrdolejs](https://discourse.nodered.org/u/petrdolejs)\
**Post date:** [20 August 2019 11:09 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/1 "2019-08-20T11:09:56Z")

</div>

Hello guys

if I have function node(if statement in there) and from that node I have two nodes. Is possible send data only to one node based on if statement?

![if%20statement](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/75a93cf31232785c1c254993d55a0f73fab9b5b4.png)  
Can I send data just to one debug node due to if statement?

Thanks for any ideas !!!

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 August 2019 11:17 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/2 "2019-08-20T11:17:12Z")

</div>

Yes, its in the docs see [https://nodered.org/docs/user-guide/writing-functions#multiple-outputs](https://nodered.org/docs/user-guide/writing-functions#multiple-outputs).

Or for an even easier solution, if your if statement is one condition, use the switch node...

---

<div class="post-metadata">

**Author:** ![petrdolejs](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@petrdolejs](https://discourse.nodered.org/u/petrdolejs)\
**Post date:** [20 August 2019 11:29 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/3 "2019-08-20T11:29:49Z")

</div>

Thanks a lot !

**Different topic**  
And do you know how to find out if everything went correctly? I put on the end of the nodes if statement and if condition is true then continue if it's false stop/do again, whatever. I use node-red-contrib-serial-modbus and when I'm receiving it will be true, but when I don't receive anything(disconnected) it stuck on first node so it can't go to condition to change output from that condition. Do you have any ideas how to do that?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 August 2019 11:33 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/4 "2019-08-20T11:33:29Z")

</div>

You could try using the catch or status nodes to see if there is a message when the equipment disconnects.

Or you could use the trigger node to send an error message if it doesn't receive a message for a period of time.

---

<div class="post-metadata">

**Author:** ![petrdolejs](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@petrdolejs](https://discourse.nodered.org/u/petrdolejs)\
**Post date:** [20 August 2019 11:44 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/5 "2019-08-20T11:44:31Z")

</div>

I want to read many devices once per 30 minutes and on the end of the line I need OK/not OK. If OK I'll go to another device a do the same. It's not just about disconnected device, I need to know if it's stuck in the middle of the line and it will don't go to the end.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 August 2019 11:53 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/6 "2019-08-20T11:53:51Z")

</div>

What is controling the reading of the signals?  
Do you send a read command or do the devices send some info at various times?  
What are the devices?

---

<div class="post-metadata">

**Author:** ![petrdolejs](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@petrdolejs](https://discourse.nodered.org/u/petrdolejs)\
**Post date:** [20 August 2019 12:03 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/7 "2019-08-20T12:03:58Z")

</div>

I've timestamp set to send signal every 30 minutes.  
Every 30 min I want to read 36 Energy meters (iEM3155).  
My idea is it should work in loop. It will read first, if OK it will read second etc. If not OK it will try again and if second try also failed it will just go to another energy meter.

---

<div class="post-metadata">

**Author:** ![tilleul](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tilleul/32/78_2.png) [@tilleul](https://discourse.nodered.org/u/tilleul)\
**Post date:** [20 August 2019 12:32 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/8 "2019-08-20T12:32:55Z")

</div>

Unless the device sends you back a message like "not ok", the only solution I see is using some kind of timeout ...

---

<div class="post-metadata">

**Author:** ![petrdolejs](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@petrdolejs](https://discourse.nodered.org/u/petrdolejs)\
**Post date:** [20 August 2019 12:37 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/9 "2019-08-20T12:37:22Z")

</div>

You mean timeout like trigger 'if don't receive something in 5 seconds, it will send something like false' ?

---

<div class="post-metadata">

**Author:** ![tilleul](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tilleul/32/78_2.png) [@tilleul](https://discourse.nodered.org/u/tilleul)\
**Post date:** [20 August 2019 12:59 UTC](https://discourse.nodered.org/t/sending-only-on-one-wire/14547/10 "2019-08-20T12:59:18Z")

</div>

something like that but I suppose it depends on how the modbus node works ...
