09-11-2008 10:05 AM
Hi there,
have a look into the attached vi, pleace. It represents the storage of data into a ring buffer of variable size with subsequent data processing. As we all learned in our first LabVIEW lessons, we should initialize the shift register through the "initialize array" function rather than with an array constant. In the latter case, LabVIEW would have to re-allocate additional memory space to the growing array as soon as the memory space of arbitrary size blocked by the initial constant is exceeded. However, if the vi is stopped before the ring buffer has been completely filled with true data we need to filter out the -inf constants that served as placeholders in the initial array. Otherwise those placeholders would interfere with the subsequent data processing, e. g. the calculation of the mean.
So, after this somewhat lengthy preface, my question is: Does anybody know how to reserve a defined memory space for an array without already writing placeholder elements into that memory before the true data arrives?
Regards,
Peter
09-11-2008 10:32 AM - edited 09-11-2008 10:33 AM
09-12-2008 02:30 AM
Thanks for your useful comment, Smercurio!
I thought that LabVIEW will not keep reshuffling memory if I wire the constant N of the For-Next-Loop?
Your solution is more elegant anyway, of course.
Peter
09-12-2008 09:09 AM
09-14-2008 11:13 AM