LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reset array (using an array as a buffer)

Hi, I'm logging data at nearly 1000Hz so I'm storing the data in an array and then writing the array to a file every so often. I have two questions:

1) How can I reset the array and get rid of all the stored values?

2) How often should I write the values in the array to a file?

Thanks.
0 Kudos
Message 1 of 2
(6,600 Views)

(1) Loop on the entire array and use the replace function to set every element e.g. to NaN
OR
Use reshape array and set the array size to 0.
Best performance will be achieved with the replace function. You should furthermore create an array of constant length (which would also satisfy your 2nd question) and exclusively work with the replace function to achieve best performance.

(2) A good compromise between not writing to the disk too often and preventing data loss might be:
Write the array every second to the disk.

Message 2 of 2
(6,588 Views)