Chapter 14
Arrays, Clusters, and Graphs
©
National Instruments Corporation
14-7
15. Continue building your block diagram as shown in the preceding block
diagram.
Sine function (Functions»Numeric»Trigonometric)—In this
activity, you use the function in a For Loop to build an array of points
that represents one cycle of a sine wave.
Build Array function (Functions»Array)—In this exercise, you use
this function to create the proper data structure to plot two arrays on a
waveform graph, which in this case is a 2D array. Enlarge the Build
Array function to create two inputs by dragging a corner with the
Positioning tool.
Pi constant (Functions»Numeric»Additional Numeric
Constants)—Remember that you can find the Multiply and Divide
functions in Functions»Numeric.
16. Switch to the front panel. Run the VI.
Notice that the two waveforms plot on the same waveform graph.
The initial X value defaults to 0 and the delta X value defaults to 1 for
both data sets.
Note
You can change the appearance of a plot on the graph by popping up in the legend
for a particular plot. For example, you can change from a line graph to a bar
graph by choosing Common Plots»Bar Graph.
17. Save the VI as
Graph Waveform Arrays.vi
in the
BridgeVIEW\
Activity directory
.
End of Activity 14-1.
In the previous example, the For Loop executed 100 times because a
constant of
100
was wired to the count terminal. The following activity
illustrates another means of determining how many times a loop will
execute.