I am having an issue with this flow. It is returning NaN and I cannot see why. I use this flow successfully on another device and it works fine, the only difference is that in this flow I read a single value from a float table, where in the flow that works the value comes from a single float variable.
[{"id":"d014f738.c3a538","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"9846f5f7.1f33a8","type":"pac-read","z":"d014f738.c3a538","device":"a1c6a2d4.8871f","dataType":"float-table","tagName":"Scales_Final","tableStartIndex":"1","tableLength":"1","value":"","valueType":"msg.payload","topic":"","topicType":"none","name":"","x":520,"y":180,"wires":[["bff3716e.21bef","643f2b4b.d0f324"]]},{"id":"4b8e09cc.7ba198","type":"inject","z":"d014f738.c3a538","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":180,"wires":[["9846f5f7.1f33a8"]]},{"id":"bff3716e.21bef","type":"function","z":"d014f738.c3a538","name":"WT4100 rate calc","func":"var WT4100 = msg.payload; //the new tank weight\nvar WT4100_wt = WT4100[0];\n\nvar WT4100_array = context.get(\"WT4100_array\")||[]; //array holding values \nvar WT4100_rate15;\nvar WT4100_rate30;\nvar WT4100_rate45;\nvar WT4100_rate60;\nvar WT4100_ratefinal;\n\nWT4100_array.length = 360;\nWT4100_array.unshift(WT4100_wt);\n\nWT4100_rate15 = (WT4100_array[89] - WT4100_array[0]) * 4;\nWT4100_rate30 = (WT4100_array[179] - WT4100_array[0]) * 2;\nWT4100_rate45 = (WT4100_array[279] - WT4100_array[0]) * 1.2857;\nWT4100_rate60 = (WT4100_array[359] - WT4100_array[0]);\n\nWT4100_ratefinal = ((WT4100_rate15 + WT4100_rate30 + WT4100_rate45 + WT4100_rate60) / 4);\nif (WT4100_ratefinal < 0.0) WT4100_ratefinal = 0.0;\n\nmsg.payload = WT4100_ratefinal;\nmsg.wtarray = WT4100_array;\nmsg.weight = WT4100_wt;\nmsg.wt4100 = WT4100_wt;\ncontext.set(\"WT4100_array\", WT4100_array);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":180,"wires":[["22956815.ab0eb8","3472e248.10dbce","7fdb619e.cdffa"]]},{"id":"22956815.ab0eb8","type":"debug","z":"d014f738.c3a538","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":180,"wires":[]},{"id":"3472e248.10dbce","type":"debug","z":"d014f738.c3a538","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1000,"y":120,"wires":[]},{"id":"7fdb619e.cdffa","type":"debug","z":"d014f738.c3a538","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1020,"y":240,"wires":[]},{"id":"643f2b4b.d0f324","type":"debug","z":"d014f738.c3a538","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":780,"y":100,"wires":[]},{"id":"a1c6a2d4.8871f","type":"pac-device","z":"","address":"localhost","protocol":"https","msgQueueFullBehavior":"DROP_OLD"}]