LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build Array in FPGA module SOMETIMES gives error "Arrays must be fixed size"

Hi,

I made an array using the build array function in an fpga vi.  There wasn't anything tricky about the array; I just took three controls x,y, and z and did a bit of math on them so I had an array that looked like x,y,z,x^2,y^2, and so on.  I got the broken arrow with the message "arrays must be fixed size in current target."

I did some troubleshooting which ended when I took the entire vi, copy-pasted it into a new vi (on the same target), and did not get an error message.  Selecting all, cutting and then pasting into the same vi did not help.  Obviously my problem is fixed because I now have a working vi, but I'm really curious what went wrong, and why copy-pasting into a new vi helped. 

My version is 8.2.  Another detail: the vi I started with was a copy of a non-FPGA vi given to me by someone else, which I'm FPGA-ifying.

Does anybody know what might have happened?

Thanks!
0 Kudos
Message 1 of 3
(5,488 Views)
Hi "all477",

The VI properties of an FPGA VI and a non FPGA VI have a slight difference.

When you open a non FPGA VI on an FPGA target, and when the VI is using arrays, you will have to do the following steps
File> VI Properties > Catergory= Execution : Check the "Autopreallocate arrays and strings".

However, when you copy the code into a new FPGA VI, this property is checked by default and so the VI is not broken!
On a non FPGA VI, this property does not exist (as it is not required).

Also note that when you are using array controls, you need to know the size of the array beforehand.
To set the size, right click on the index of array control/ indicator. Select array dimension size, and size to "Fixed" and enter the size.

Good question!



Message 2 of 3
(5,462 Views)
Thanks for the reply!  It's good to know just what is going on.
0 Kudos
Message 3 of 3
(5,428 Views)