Our online shopping is experiencing intermittent service disruptions.

Support teams are actively working on the resolution.

Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Circular Buffer

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.

 

circ.png

Comments
altenbach
Knight of NI Knight of NI
Knight of NI
on

I think it could be dramatically simplified:

 

altenbach_0-1703003822678.png

 

EMCCi
Member
Member
on

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:

EMCCi_0-1706629871381.png

 

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:

EMCCi_1-1706630433976.png

 

Contributors