Professional Documents
Culture Documents
Introduction
Inthishomework,youwilllearnaboutthedifferencesandsimilarities
betweengraphsandchartsandwhentouseeach.Youwillalsowrite
simpleVIstoincorporatearraysandclustersinLabVIEWasameansof
combiningdata.
Objective
Learnthedifferencebetweenachartandagraph.
Differentiatebetweenthethreeupdatemodesofachart.
Learnhowtocreateanarrayandmanipulateit.
Learnthedifferencebetweenaclusterandanarray.
Theory
LabVIEW Graphs, Charts, Arrays, and Clusters
Introduction
Inthissectionyouwilllearnaboutgraphsandcharts,theirsimilaritiesand
differences,andwhentouseeach.Youwillalsostudyarraysandclusters,
twowaystogroupdata.
GraphsandCharts
Usegraphsandchartstodisplayplotsofdatainagraphicalform.
Graphsandchartsdifferinthewaytheydisplayandupdatedata.VIswith
graphsusuallycollectthedatainanarrayandthenplotthedatatothe
graph,whichissimilartoaspreadsheetthatfirststoresthedatathen
generatesaplotofit.Incontrast,achartappendsnewdatapointstothose
alreadyinthedisplay.Onachart,youcanseethecurrentreadingor
measurementincontextwithdatapreviouslyacquired.
ThegraphsandchartslocatedontheControlsGraphpaletteincludethe
followingtypes:
WaveformChartandGraphDisplaysdataacquiredataconstant
rate.
XYGraphDisplaysdataacquiredatanonconstantrate,suchasdata
acquiredwhenatriggeroccurs.
IntensityChartandGraphDisplays3Ddataona2Dplotbyusing
colortodisplaythevaluesofthethirddimension.
DigitalWaveformGraphDisplaysdataaspulsesorgroupsofdigital
lines.Computerstransferdigitaldatatoothercomputersinpulses.
(Windows)3DGraphsDisplays3Ddataona3DplotinanActiveX
objectonthefrontpanel.
Youcustomizetheappearanceofgraphsandchartsbyshowingorhiding
options.RightclickthegraphorchartandselectVisibleItemsfromthe
shortcutmenutodisplayorhidethefollowingoptions:
PlotLegendDefinesthecolorandstyleoftheplot(s).Resizethe
legendtodisplaymultipleplots.
ScaleLegendDefineslabelsforscalesandconfiguresscaleproperties.
GraphPaletteChangesscalingandformattingwhileaVIisrunning.
XScaleandYScaleFormatsthexandyscales.
CursorLegend(graphonly)Displaysamarkeratadefinedpoint
coordinate.Youcandisplaymultiplecursorsonagraph.
Scrollbar(chartonly)Scrollsthroughthedatainthechart.Usethe
scrollbartoviewdatathatthebufferdoesnotcurrentlydisplay.
Arrays
Array function is a 2D array and you wire only the row input, you
extract a complete 1D row of the array. If you wire only the
column input, you extract a complete 1D column of the array. If
you wire the row input and the column input, you extract a single
element of the array. Each input group is independent and can
access any portion of any dimension of the array.
To access multiple consecutive values in an array, expand the
Index Array function, but do not wire values to the index inputs in
each increment. For example, to retrieve the first, second, and third
rows from a 2D array, expand the Index Array function by three
increments and wire 1D array indicators to each sub-array output.
Clusters
Homework Procedure
Part 1. Temperature Monitor VI
CompletethefollowingstepstobuildaVIthatusesaWhileLoopanda
waveformcharttoacquireanddisplaydata.
1. Open a new VI.
2. Build the following front panel.
10
11
12
13
14
15
16
Set the point style of the waveform graph Temp plot to a small square.
Do not create the Mean, Max, and Min indicators yet.
2. Build the following block diagram.
a. Select FunctionsTutorialDigital
Thermometer.vi. This VI returns simulated
temperature measurements.
b. Place the Wait Until Next ms Multiple function located on the
FunctionsTime & Dialog palette and create a constant of 250.
This function causes the For Loop to execute every 0.25 s (250
ms).
c. Place the Array Max & Min function located on the
FunctionsArray palette. This function returns the maximum and
minimum temperature.
d. Place the Mean VI located on the
FunctionsMathematicsProbability and Statistics palette. This
VI returns the average of the temperature measurements.
e. Right-click the output terminals of the Array Max & Min
function and Mean VI and select CreateIndicator from the
shortcut menu to create the Max, Min, and Mean indicators.
17
18
19