The attached example VI (saved in LabVIEW 2015) illustrates how to implement a circular buffer. Furthermore, it allows for dynamically changing the size of the buffer while the code is running.
This works flawless for me, requires no explicit initialization and it's already intended to work as independent circular buffer subVI with the data generation & timing parts removed:
Also, after a little bit of testing I have seen that altenbach (haven't tested Darren one) design unnecessary loses data when the buffer it's already full and gets expanded, placing always a 0 at the beginning of the array in place of the unnecessary deleted element. This design should solve that but I don't know if it adds any extra bad behavior, but I didn't notice any.
Also, for array input:
Can you post the VI for that first one above @EMCCi? I built what you have there and testing it, and it just constantly adds the element to the end, that gets cut off in the reshape. I like how simple yours is, but that doesn't really work for me. maybe i could test your VI?
Every time you iterate, the 3 in this iteration, gets reshaped off. Wondering if it is supposed to insert at index 0? was that the intent there?
@EMCCi can you please provide a VI to your second design?
@wdenny3885 can you please provide a VI of your design?
Sorry guys for not answering. I've been busy.
I don't know why but it doesn't allow to me to upload the VI, says .vi format is not compatible. Maybe a bug??
I leave you this link here, but I think you will need to hurry up before it gets deleted: https://filebin.net/26240j3yiuspq7yg
EDIT: For me works, even for dynamic buffer size, so I would be scared if you tell me that it doesn't.
EDIT2: Backup link with longer live: https://easyupload.io/m/nv86ih