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?
Can I send data just to one debug node due to if statement?
Thanks for any ideas !!!
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?
Can I send data just to one debug node due to if statement?
Thanks for any ideas !!!
Yes, its in the docs see 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...
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?
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.
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.
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?
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.
Unless the device sends you back a message like "not ok", the only solution I see is using some kind of timeout ...
You mean timeout like trigger 'if don't receive something in 5 seconds, it will send something like false' ?
something like that but I suppose it depends on how the modbus node works ...