Problem sending array from function to table

I am sending object arrays to tables. I have to pad function node with a dummy output to get the first table to update consistently. The output line is as below.
It must be a timing problem because just returning 'null' to output1 does not work but 'msg' does.

return [msg,{payload:array1},{payload:array2}];

Just for info running on a Pi, arrays are not huge: biggest is [25] [5] text strings of max length 9 chrs.

If you put a debug node on o/p 1 (in the failing condition) is the data correct?
If not then show us the rest of the function.

[Edit] It may be that array1 is being modified before it is being used. In javascript objects and arrays are passed by reference not by copying, so if the same array object is being referenced in several places then changing it in one place changes it in all of them.

Thanks for the reply I was not making multiple references to the array, although there are sequential flows, of ASCII strings@9600 BAUD so I suppose buffering may have been overloaded. I have had a code tidy-up and the problem has 'gone away' Just have put that down to experience. Attached the non-problem flow FWIW
flows (5).json (9.5 KB)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.