Looking for some help on how to accomplish the following: I will explain what I am trying to accomplish then paste my flow below. I want to capture some data at the start and end of a test period, then combine this data in a single payload and write it to a csv file. The data is contained in separate float tables for the start period, and the end period. When the period starts, the operator clicks a button on the HMI, which reads values into the float table, and also sets an I32 variable equal to 1. The rbe node allows flow to continue once the value is 1 and gets the start data from the float table. The end period is done the same way. I end up with two payloads, how can they be combined into a single one to use the csv node?
[{"id":"af669554.ee2258","type":"tab","label":"Flow 6","disabled":false,"info":""},{"id":"2a54dbcb.a786e4","type":"inject","z":"af669554.ee2258","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":60,"wires":[["585d796a.620e58","ae4187fb.d699f8"]]},{"id":"6b10b0f5.2f5c3","type":"pac-read","z":"af669554.ee2258","device":"31b5623c.c2558e","dataType":"float-table","tagName":"MatBalstart_data","tableStartIndex":"0","tableLength":"10","value":"payload","valueType":"msg","topic":"","topicType":"none","name":"","x":500,"y":160,"wires":[["c78c58d6.2af158"]]},{"id":"3537ab78.4243a4","type":"rbe","z":"af669554.ee2258","name":"","func":"deadbandEq","gap":"1","start":"","inout":"in","property":"payload","x":320,"y":160,"wires":[["6b10b0f5.2f5c3"]]},{"id":"e45aa1a.87f9b6","type":"pac-read","z":"af669554.ee2258","device":"31b5623c.c2558e","dataType":"float-table","tagName":"MatBalend_data","tableStartIndex":"0","tableLength":"10","value":"payload","valueType":"msg","topic":"","topicType":"none","name":"","x":500,"y":240,"wires":[["c78c58d6.2af158"]]},{"id":"224bc154.347d2e","type":"rbe","z":"af669554.ee2258","name":"","func":"deadbandEq","gap":"1","start":"","inout":"in","property":"payload","x":320,"y":240,"wires":[["e45aa1a.87f9b6"]]},{"id":"585d796a.620e58","type":"pac-read","z":"af669554.ee2258","device":"31b5623c.c2558e","dataType":"int32-variable","tagName":"MatBalstart_flag","tableStartIndex":"","tableLength":"","value":"","valueType":"msg.payload","topic":"","topicType":"none","name":"","x":140,"y":160,"wires":[["3537ab78.4243a4"]]},{"id":"ae4187fb.d699f8","type":"pac-read","z":"af669554.ee2258","device":"31b5623c.c2558e","dataType":"int32-variable","tagName":"MatBalend_flag","tableStartIndex":"","tableLength":"","value":"","valueType":"msg.payload","topic":"","topicType":"none","name":"","x":140,"y":240,"wires":[["224bc154.347d2e"]]},{"id":"f7476990.bee2c8","type":"function","z":"af669554.ee2258","name":"","func":"var start_data = msg.start;\nstart_data = context.get(\"start_data\")||[]; //array holding the start data\nvar end_data = msg.end;\nend_data = context.get(\"end_data\")||[]; //array holding the end data\nvar final_data = [];\nfinal_data = context.get(\"final_data\")||[]; //array holding the final data\n\nfinal_data[0] = start_data[0];\nfinal_data[1] = start_data[1];\n\n\ncontext.set(\"start_data\", start_data);\ncontext.set(\"end_data\", end_data);\ncontext.set(\"final_data\", final_data);\n\nmsg.payload = final_data;\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":260,"wires":[[]]},{"id":"142d8dd3.8a9452","type":"debug","z":"af669554.ee2258","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":910,"y":200,"wires":[]},{"id":"c78c58d6.2af158","type":"join","z":"af669554.ee2258","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":720,"y":200,"wires":[["142d8dd3.8a9452"]]},{"id":"31b5623c.c2558e","type":"pac-device","z":"","address":"10.0.4.10","protocol":"http"}]