Instructors Portion
Summary
The students will learn about the differences and similarities between
graphs and charts and when to use each. They will also write simple VIs
to incorporate arrays and clusters in LabVIEW as a means of combining
data.
Uses
This homework applies to all general instrumentation courses.
Equipment List
Computer with LabVIEW
References
LabVIEW Users Manual. November 20xx. Part Number 320999D01.
LabVIEW Student Edition.
Students Portion
Introduction
In this homework, you will learn about the differences and similarities
between graphs and charts and when to use each. You will also write
simple VIs to incorporate arrays and clusters in LabVIEW as a means of
combining data.
Objective
Learn the difference between a chart and a graph.
Differentiate between the three update modes of a chart.
Learn how to create an array and manipulate it.
Learn the difference between a cluster and an array.
Theory
LabVIEW Graphs, Charts, Arrays, and Clusters
Introduction
In this section you will learn about graphs and charts, their similarities and
differences, and when to use each. You will also study arrays and clusters,
two ways to group data.
Graphs and Charts
Use graphs and charts to display plots of data in a graphical form.
Graphs and charts differ in the way they display and update data. VIs with
graphs usually collect the data in an array and then plot the data to the
graph, which is similar to a spreadsheet that first stores the data then
generates a plot of it. In contrast, a chart appends new data points to those
already in the display. On a chart, you can see the current reading or
measurement in context with data previously acquired.
The graphs and charts located on the ControlsGraph palette include the
following types:
Waveform Chart and GraphDisplays data acquired at a constant
rate.
XY GraphDisplays data acquired at a non-constant rate, such as data
acquired when a trigger occurs.
Intensity Chart and GraphDisplays 3D data on a 2D plot by using
color to display the values of the third dimension.
Digital Waveform GraphDisplays data as pulses or groups of digital
lines. Computers transfer digital data to other computers in pulses.
(Windows) 3D GraphsDisplays 3D data on a 3D plot in an ActiveX
object on the front panel.
You customize the appearance of graphs and charts by showing or hiding
options. Right-click the graph or chart and select Visible Items from the
shortcut menu to display or hide the following options:
Plot LegendDefines the color and style of the plot(s). Resize the
legend to display multiple plots.
Scale LegendDefines labels for scales and configures scale properties.
Graph PaletteChanges scaling and formatting while a VI is running.
X Scale and Y ScaleFormats the x- and y-scales.
Cursor Legend (graph only)Displays a marker at a defined point
coordinate. You can display multiple cursors on a graph.
Scrollbar (chart only)Scrolls through the data in the chart. Use the
scroll bar to view data that the buffer does not currently display.
Arrays
Clusters
To wire clusters, both clusters must have the same number of elements.
Corresponding elements, determined by the cluster order, must have
compatible data types. For example, if a double-precision floating-point
numeric in one cluster corresponds in cluster order to a string in the other
cluster, the wire on the block diagram appears broken and the VI does not
run. If numerics of different representations, LabVIEW coerces them to
the same representation.
Homework Procedure
Part 1. Temperature Monitor VI
Complete the following steps to build a VI that uses a While Loop and a
waveform chart to acquire and display data.
1. Open a new VI.
2. Build the following front panel.
10
8IQT, and click outside the label or click the Enter button to
11
6. Wire the block diagram objects as shown in the previous block diagram.
7. Save the VI as 8IQTIVEXYVI 1SRMXSVZM.
8. Display the front panel by clicking it or by selecting Window
Show Panel.
9. Use the Operating tool to click the vertical toggle switch and turn it to
the ON position.
10. Run the VI.
The section of the block diagram within the While Loop border, or
subdiagram, executes until the specified condition is TRUE. For example,
while the switch is on (TRUE), the Thermometer VI takes and returns a
new measurement and displays it on the waveform chart.
11. Click the vertical toggle switch to stop the acquisition. The condition
is FALSE, and the loop stops executing.
12. Format and customize the X and Y scales of the waveform chart.
a. Right-click the chart and select Y ScaleFormatting from the
shortcut menu. A dialog box appears.
b. Click the Scale Style icon and select different styles for the yaxis. You also can select different mapping modes, grid options,
scaling factors, and formats and precisions.
12
c. Select the options shown in the previous dialog box and click the
OK button.
13. Right-click the waveform chart and select Data OperationsClear
Chart from the shortcut menu to clear the display buffer and reset the
waveform chart. If the VI is running, you can select Clear Chart from the
shortcut menu.
14. Modify the vertical toggle switch so temperature is plotted on the
graph each time you run the VI.
a. Stop the VI if it is running.
b. Use the Operating tool to click the vertical toggle switch and
turn it to the ON position.
c. Right-click the switch and select Data OperationsMake
Current Value Default from the shortcut menu. This sets the ON
position as the default value.
d. Right-click the switch and select Mechanical ActionLatch
When Pressed from the shortcut menu.
15. Run the VI.
16. Use the Operating tool to click the vertical switch to stop the
acquisition. The switch changes to the OFF position and changes back to
ON after the conditional terminal reads the value.
When this VI runs, the While Loop executes as quickly as possible.
Complete the following steps to take data at certain intervals, such as once
every half-second, as shown in the following block diagram.
13
14
15
16
17
18
Homework Report
Submit your report according the standard format and include also
the answers to the questions below. Due on <date>.
Data Sheet
Questions
1. How is a chart different from a graph?
2. What are the three update modes of a chart? Briefly describe each.
4. Below is a 2D array:
2 4 7 5 1
6 9 3 4 5
2 5 8 4 9
19
20