hi again, added update i've done some tinkering and i managed to make it work for my bespoke backward data acquisition method!!! see:
- the arrangement of the flow:
[{"id":"e485991ccf3e0822","type":"serial in","z":"11abe06410824819","name":"","serial":"6929e66dfb37b765","x":180,"y":240,"wires":[["dad545f1b5f6476c"]]},{"id":"8d630393845bd583","type":"ui_text","z":"11abe06410824819","group":"e926a6330eaa482e","order":0,"width":"0","height":"0","name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","className":"","style":true,"font":"","fontSize":16,"color":"#000000","x":830,"y":220,"wires":[]},{"id":"4bfbe73e0ce0a23d","type":"function","z":"11abe06410824819","name":"add time","func":"var stamp;\nmsg.payload = new Date().toString() + '\\n' + msg.payload;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":140,"wires":[["245ca36fe017d921","d1156230815e2561","8d630393845bd583"]]},{"id":"245ca36fe017d921","type":"file","z":"11abe06410824819","name":"test file","filename":"C:\\Users\\223131446\\documents\\testfile","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":860,"y":140,"wires":[[]]},{"id":"d1156230815e2561","type":"debug","z":"11abe06410824819","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":820,"y":40,"wires":[]},{"id":"dad545f1b5f6476c","type":"function","z":"11abe06410824819","name":"payload buffer","func":"// Get the cycle var from this node's context store or set to 0 if it doesn't yet exist\nlet cycle = context.get('cycle') ?? 0\n\n// Get the data buffer or an empty array if not exists yet\nconst databuff = context.get('databuff') ?? []\n\n// Add the new data to the buffer\ndatabuff.push(msg.payload)\n\n// Increment the cycle count\ncycle++\n\nif (cycle == 2) {\n // Output the buffer (join the array as a string)\n node.send({payload: databuff.join('')})\n // reset the buffer\n context.set('databuff', [])\n // reset the counter\n context.set('cycle', 0)\n} else {\n context.set('databuff', databuff)\n context.set('cycle', cycle)\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":160,"wires":[["4bfbe73e0ce0a23d"]]},{"id":"6929e66dfb37b765","type":"serial-port","name":"Nano IN","serialport":"COM5","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"},{"id":"e926a6330eaa482e","type":"ui_group","name":"Arduino Monitor Page","tab":"f95d506942394920","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f95d506942394920","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
- my output file (that is overwritten each time it is written with data!:
thank you so much mate!!