hi.. new here and first steps with node-red.
I had convert a global integer (filled with: 32785) split in a 16Bit-Array.
the array shows as well.
but when I try to compare an object of thay array (p.e. array_status_base2[15]) I receive an msg.payload : undefined
what do I wrong, or where is my fault?
thanks in advance
Patrick
here's my flow:
[{"id":"56f842d.16df13c","type":"debug","z":"d27eace5.68918","name":"","active":true,"console":"false","complete":"false","x":510,"y":60,"wires":[]},{"id":"c4cadc76.48a9a8","type":"function","z":"d27eace5.68918","name":"Test","func":"var status = {payload:context.global.wBetriebsStatus_01};\nvar array_status_base2 = {payload:(context.global.wBetriebsStatus_01.toString(2)).split(\"\")};\nvar heiz = {payload:array_status_base2[15]}; \nvar kuehl = {payload:array_status_base2[14]}; \n\n// if (array_status_base2[15] === \"1\") var Status_text = \"Heiz-Betrieb\" ;\n// if (array_status_base2[14] === \"1\") var Status_text = \"Kühl-Betrieb\" ;\n// if (array_status_base2[13] === \"1\") var Status_text = \"Totzone\" ;\n// if (array_status_base2[12] === \"1\") var Mode_text = \"Automatik\" ;\n// if (array_status_base2[11] === \"1\") var Mode_text = \"Handbetrieb\" ;\n \nreturn [status, array_status_base2,heiz,kuehl];\n","outputs":"4","noerr":0,"x":290,"y":60,"wires":[["56f842d.16df13c"],["56f842d.16df13c"],["56f842d.16df13c"],["56f842d.16df13c"]]},{"id":"b474b5e9.eb98","type":"inject","z":"d27eace5.68918","name":"Test Trigger","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":130,"y":60,"wires":[["c4cadc76.48a9a8"]]}]