07-06-2018 03:47 PM
I'm trying to make a 2D array inside a while loop so that when a new 1D array is inserted, it automatically adds it to the end and deletes the oldest data. In this way the array size will remain the same and the 2D array will be continuously updated. I used the insert array function but it keeps adding new 1D arrays to the existing 2D array without deleting the oldest array, resulting in increasing array size. How do you insert a 1D array into 2D array while simultaneously deleting the oldest array?
Solved! Go to Solution.
07-06-2018 05:49 PM
Use replace array subset instead. See image below and attached VI, version 2014.
mcduff
07-06-2018 06:53 PM
I assume this will run continuously. It might be much cheaper to replace the oldest row instead of constantly rotating the data with every insertion. What's the overall purpose?
07-07-2018 08:28 AM
You need to create a simple flow in your labview code where you delete the first row before or after you add the new data in the last row.
07-08-2018 12:55 PM
Sounds like you want a circular buffer. This library might have a ready made solution for you:
http://www.ni.com/tutorial/7188/en/
07-08-2018 09:08 PM
Thank you! deleting before inserting with array subset function worked!