Multiple output function in node-red

This is sample flow for multiple output in one function in node-red

[{"id":"5f08a336.d9c24c","type":"function","z":"2aaa7997.d6ad76","name":"","func":"raw = msg.payload.object;\n\nvar msg1 = { payload:raw.analogInput[1]};\nvar msg2 = { payload:raw.analogInput[2]};\nvar msg3 = { payload:raw.analogOutput[3]};\nvar msg4 = { payload:raw.temperatureSensor[3]};\nvar msg5 = { payload:raw.humiditySensor[4]};\nvar msg6 = { payload:raw.barometer[5]};\n\n\nreturn [ msg1, msg2, msg3, msg4, msg5, msg6 ];\n\n// msg.payload ={\n//     battery : raw[1],\n//     solar:raw[2]\n// }\n// return msg;","outputs":6,"noerr":0,"initialize":"","finalize":"","x":520,"y":660,"wires":[["719a5264.f5757c"],["1d8c7f1.9f75281"],["e4b2ebe4.6b0728"],["418e174c.6f7258"],["46ea126c.0ec36c"],["703fee7.477581"]]}]

Ditunggu komennya ...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.