From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA dynamically changing array problem

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!

 

Download All
0 Kudos
Message 1 of 2
(5,080 Views)

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).

Message 2 of 2
(5,057 Views)