Implementing Variable-Sized Arrays in FPGA VIs

You can create FPGA VIs with variable-sized arrays that resolve to a single size at compile time. When you compile an FPGA VI into a bitfile, multiple implementations of code cannot be called dynamically. This restriction means that LabVIEW must determine the size of an array input or output at compile time. The following table describes behaviors, caveats, and restrictions for implementing variable-sized arrays in FPGA applications.

Array Operations For each function that supports array inputs or outputs in the FPGA Module, LabVIEW determines the size of an array output by examining the inputs of a function. If a function includes only scalar or fixed-size array inputs, LabVIEW infers a fixed-size array output. LabVIEW returns an error if it cannot infer a fixed size.
Classes and Clusters You can embed arrays that resolve to a single size at compile time in clusters and classes.
SubVIs LabVIEW tracks inferred array sizes of subVIs in order to propagate them in and out of an FPGA VI. For non-reentrant subVIs, if an array size inferred through one call does not match the size of another call, LabVIEW returns an error for the front panel control along with all calls to that VI.
Shift Registers Uninitialized shift registers default to an array size of zero. For initialized shift registers, LabVIEW infers the array size by examining the input terminals. If sizes of the initialized inputs do not match, LabVIEW returns an error.
Feedback Nodes LabVIEW compares the array size on the input terminal of the Feedback Node to the size of the initializer terminal. If the sizes do not match, LabVIEW returns an error. For uninitialized Feedback Nodes, LabVIEW infers a size of zero for the initializer terminal.
Select Function LabVIEW infers the output array size of a Select function only if both input array sizes statically resolve to the same fixed size at compile time. Otherwise, LabVIEW returns an error.
Case Structures LabVIEW infers the array size of a Case structure output tunnel only if the input array sizes of all diagrams within the Case structure statically resolve to the same fixed size at compile time. Otherwise, LabVIEW returns an error.
For Loops LabVIEW infers the array size of an auto-indexed output tunnel based on the number of times the For Loop executes. You must wire a constant value to the count terminal. LabVIEW returns an error if the size of the array output is not statically resolved.
Coercions Wiring a variable-sized array to a fixed-size terminal where the array sizes do not match, as with subVI terminals and indicators, results in coerced data that is padded or truncated to the terminal size. When you wire a fixed-size array to a variable-sized terminal, the array size of the fixed type propagates forward.
Bounded Arrays LabVIEW infers the size of bounded arrays at or below the bound. LabVIEW returns an error if the size of a bounded array cannot resolve to a single size at compile time.
Autopreallocate Arrays and Strings If you select the Autopreallocate arrays and strings checkbox on the Execution page of the VI Properties dialog box, you can mix fixed-size and variable-sized arrays and LabVIEW coerces the data.