LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array constant

Solved!
Go to solution

Hi all,

 

Is there a simple way to create/define an array constant of large values? Say i want a 1D array constantof 1000 rows, with the row values are from 1 to1000. This array will never change while the program is running but will be used many times. Is creating an empty array constant and entering the 1000 values manually the only way?

 

Thanks in advance

Rishe.

0 Kudos
Message 1 of 4
(2,895 Views)
Generate the array using your favorite technique, read from file, for loop, etc. using an indicator.  Find the block diagram terminal of the array indicator, right-click and select create constant.  Voila
Message 2 of 4
(2,891 Views)
Solution
Accepted by topic author Rishe

Easy... populate an array with the values you want -- just run a for loop in a throw away VI to populate -- then right-click on the array terminal on the diagram and select create constant.

 

Randy

Message 3 of 4
(2,887 Views)
Instead of having a constant you could also create a trivial VI that uses a LabVIEW 2-style global (aka functional global, aka action engine "lite") and simply uses the First Call? primitive to create the array the first time it's used.
0 Kudos
Message 4 of 4
(2,883 Views)