Summary: Create arrays and become familiar with the Array functions.
Complete the following steps to build a VI that creates an array of random numbers, scales the resulting array, and takes a subset of that final array.
![]() |
array, located on the
Controls>>All Controls>>Array & Cluster
palette, on the front panel.
Random Array.
numeric indicator, located on the
Controls>>Numeric Indicators palette, in
the array shell.
Positioning tool to resize the
array control to contain
numeric
indicators.
<Ctrl> key while you click and
drag the Random Array control to create two
copies of the control.
Final Array and
Subset Array.
numeric controls, located on
the Controls>>Numeric Controls palette, and
label them Scaling Factor, Start
Subset, and # of Elements.
Start Subset and # of
Elements controls and select
Representation>>I32 from the shortcut menu.
![]() |
Place the Random Number (0-1) function,
located on the Functions>>Arithmetic &
Comparison>>Express Numeric palette, on the block
diagram. This function generates a random number between
Place the For Loop, located on the
Functions>>All Functions>>Structures
palette, on the block diagram. The loop accumulates an
array of
Place the Multiply function, located on the
Functions>>Arithmetic & Comparison>>Express
Numeric palette, on the block diagram. In this
exercise this function multiplies Random
Array by Scaling Factor and returns
Final Array.
Place the Array Subset function, located on the
Functions>>All Functions>>Array palette, on
the block diagram. This function returns a portion of an
array starting at Start Subset and
containing # of Elements elements.
Array Exercise.vi in the
C:\Exercises\ LabVIEW Basics I directory.
For Loop runs for
Random Array displays an array of
Random Array by
Scaling Factor to create Final
Array. The VI takes a subset of Final
Array starting at Start Subset for
# of Elements and displays the subset in
Subset Array.
"A full introductory course on programming with LabVIEW."