I'm trying to get the ModBus flexwriter to work, but I am getting unreliable results using multiple function nodes as input the Flexwriter node. Seems I cant trust in which order the different node sends to the flexwriter.
Instead I would like to write all inputs in on function node i.e. have multiple objects send from one function node.
I was trying to this example from the node-red documentation, but this does not work for me and I can't figure out where it is going wrong.
I get only the first line, the remain three messages disappear and there is no second output.
var msg1 = { payload:"first out of output 1" };
var msg2 = { payload:"second out of output 1" };
var msg3 = { payload:"third out of output 1" };
var msg4 = { payload:"only message from output 2" };
return [ [ msg1, msg2, msg3 ], msg4 ];
Thank you in advance
The code you posted should work. Are you sure you have the brackets in the right places?
Can you create a flow consisting of an inject node, the function node, and two debug nodes on the outputs and check that shows the problem. If so then export that here so we can replicate it. When pasting the flow here use the </> button at the top of the forum edit window and paste it in.
@Steve, Works perfectly. @Colin, Still not working for me. I was trying out the example to try get to what Steve just send me. Just to better understand how it works I will try again later to see if I can make the example work.