06-01-2014 06:43 PM
Hi All,
In a continuation of a problem posted earlier (same project, new problem), I'm using an array as a storage of 'time stamps'. Basically, elements get added to the array when a signal is detected and the oldest element gets compared to the current time + delay and removed after further action is initiated in the next loop. (see attached vi for a full simplified program and the png for the relevant array section).
I don't know the size of the array beforehand, but I doubt it would ever even fill up more than 5 elements at a time. However, even when I set my array as fixed with a certain length and I check the 'Autopreallocate arrays and strings' checkbox, I'm still getting "Arrays must be fixed size in current target' errors.
What am I doing wrong? From reading the documentation it sounds like I should be allowed to use build array and delete from array when using a fixed length array and constants.
Thanks a lot for your help!
06-02-2014 09:47 AM
The build array operator in a case structure is going to produce a variable-size (or at least non-fixed-size) array. If you want to bound the array to 5 elements you can use the index array and replace array subset nodes on a 5 element fixed-size array and track the "current" size in a separate code path (simple implementation of a bounded-size array).