Summary: To create an array by auto-indexing a For Loop and to plot the array on a waveform graph.
Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
Complete the following steps to build a VI that generates and
plots an array on a waveform graph and modify the
VI to graph multiple plots.
![]() |
array, located on the
Controls>>All Controls>>Array &Cluster
palette, on the front panel.
Waveform Array.
numeric indicator, located on the
Controls>>Numeric Indicators palette, in
the array shell.
waveform graph, located on the
Controls>>Graph Indicators palette, on
the front panel.
![]() |
Thermometer VI on the block
diagram. Select Functions>>All Functions>>Select
a VI and navigate to C:\Exercises\ LabVIEW
Basics I\Thermometer.vi. This subVI returns one
temperature reading during each For Loop
iteration.
(Demo) Thermometer VI if you do
not have a DAQ device available.
Place a For Loop, located on the
Functions>>All Functions>>Structures
palette, on the block diagram. In this exercise, each
For Loop iteration generates a temperature
value and stores it in the indexed tunnel. Create a
constant of 100 for the count terminal.
Context Help window for more information
about wiring the objects, including whether to use a
Build Array or Bundle
function, the order of the input terminals, and so
on. In general, use a waveform chart for
single scalar points, a waveform graph
for an array of y values, and an XY graph
for an array of
waveform
graph terminal on the block diagram, the
information shown in Figure 3 appears in
the Context Help window. Select
Help>>Find Examples to launch the
NI Example Finder, double-click
Fundamentals, double-click Graphs
and Charts, and double-click the Waveform
Graph VI to open the example. Refer to the
lesson on Data Acquisition and
Waveforms for more information about the
waveform data type.
![]() |
Graph Waveform Array.vi in the
C:\Exercises\LabVIEW Basics I directory.
waveform
graph.
Waveform
Array index display to view the value of that
element. If you enter a number greater than the array size
of 100, the display dims.
Positioning tool to resize
Waveform Array to view more than one
element. The indicator displays elements in ascending index
order, beginning with the index you entered.
In this block diagram, you use the default value of the
initial Bundle function to specify an initial
waveform array.
![]() |
Place the Bundle function, located on the
Functions>>All Functions>>Cluster palette,
on the block diagram. This function assembles the plot
elements into a single cluster. The elements include the
initial Dx. Use the
Labeling tool to select the D
and select the Symbol font from the
Text Settings pull-down menu on the
toolbar. D converts to the delta symbol
(Δ). Bundle function or in the Waveform
Graph Properties dialog box.waveform graph and select
Visible Items>>Graph Palette from the shortcut
menu to display the graph palette. Click the
Zoom button to see the data on the graph in
more detail.
Visible Items>>Scale
Legend from the shortcut menu to display the scale
legend.
![]() |
Sine function, located on the
Functions>>Arithmetic & Comparison>>Express
Numeric>>Express Trigonometric palette, on the
block diagram. Use this function to build an array of
points that represents one cycle of a sine wave.
Build Array function, located on
the Functions>>All Functions>>Array
palette, on the block diagram. This function creates the
data structure to plot two arrays on a waveform
graph.
Place the pi constant, located on the
Functions>>Arithmetic & Comparison>>Express
Numeric>>Express Numeric Constants palette, on
the block diagram.
waveform graph.
Waveform Array ,
select Custom Probes>>Controls>>Graph
Indicators from the shortcut menu, and select a
waveform graph to place a graph probe on the wire.
Probe window.
Click the Zoom button on the graph palette,
shown in Media 12, to display the
Zoom pull-down menu.
Zoom by X Rectangle, as shown in
Figure 6.
![]() |
Zoom by Y Rectangle
or Zoom by Selected Area. Experiment with
these options.
Select Undo Zoom from the lower left corner
of the pull-down menu to undo a zoom or click the x-axis
single fit button and the y-axis single fit button on
the scale legend, shown in Media 14 and
Media 15.
Use the Panning tool, shown in Media 16, to click and drag the graph display. Click
the x-axis and y-axis single fit buttons again to restore
the display to its original position.
Use the Cursor Movement tool, shown in Media 17, to return the cursor to standard mode.
"A full introductory course on programming with LabVIEW."