Professional Documents
Culture Documents
Activity 6-Graphing in LabVIEW
Activity 6-Graphing in LabVIEW
GRAPHING
IN LABVIEW
Activity No. 6
I. INTENDED
LEARNING
OUTCOMES
At the
end of this
activity, the
student shall
be able to:
1.
Understand the difference between LabVIEWs charts and grahs.
2. Display data and waveforms into a bar and charts.
3. Configure charts and graphs for data presentation.
LabVIEW provides a number of charting and graphing options for producing data plots. The table
below summarizes the most commonly used chart and graph types in LabVIEW.
Page 1
ECE 100 Fundamentals of LabVIEW Programming
Scope Chart: This mode has a retracing display similar to an oscilloscope. As it receives
each new value, it plots the value to the right of the last value. When the plot reaches the
right border of the plotting area, it erases the plot and begins plotting again from the left
border.
Sweep Chart: This mode acts much like the scope chart, but the plot is not erased when
the plot hits the right border. Instead, a moving vertical line marks the beginning of new
data and moves across the display from left to right as it adds new data.
1. You will be plotting a sinusoidal waveform using a Waveform Chart and a Waveform Graph. Create a
Front Panel and Block Diagram as shown. Save your VI as Act6_1_1.VI
To access Waveform Chart, right click anywhere in Front Panel and choose
ControlsModernGraphWaveform Chart.
To access Waveform Graph, right click anywhere in Front Panel and choose
ControlsModernGraphWaveform Graph. Provide also a Numerical Indicator above the
displays.
3. On the Block diagram, drag and drop a For-loop structure and put inside the following objects: Wait
until ms set to 25, sin function, Waveform Chart, and the Numeric Indicator.
4. Outside the For-loop structure, put a Multiply function on the Iteration condition, N by dividing 200 to
a constant pi. To put a constant pi, right click anywhere in the Block Diagram and choose
FunctionsProgrammingNumericMath ConstantsPi.
Question: Why is that the iteration condition is set to 200pi? What does it do in the program?
Question: What is the purpose of Wait until ms function inside the For-loop structure?
Question: What will happen if you put the Waveform Graph inside a For-loop structure and connect
it to the output terminal of the sin function? Why does that happen?
Page 2
ECE 100 Fundamentals of LabVIEW Programming
1. You are about to modify the last saved VI from Activity 6.1. The chart and graph can be configured
using the Property dialog box. Save this VI as Act6_2_1.VI
2. Right click on the Waveform Chart and choose PropertiesUpdate modeSelect Scope chart and
then run the VI. And then after running in the Scope Chart mode, right click on the Waveform Chart and
choose PropertiesUpdate modeSelect Sweep chart and then run the VI.
4. Explore the Property dialog box of the Charts and Graphs and customize your plots. SCREEN-
CAPTURE your graphs and charts and include it in your activity report.
Question: How do we visually customize our charts and graphs to make it presentable? Explain it
in a procedural manner.
Page 3
ECE 100 Fundamentals of LabVIEW Programming
1. Create a VI with the following Front Panel and Block Diagram as shown. Save your VI as Act6_3_1.VI
Question: What function did you use to superimpose two plots in a single chart or graph? Explain
this function.
1. Create a VI that would plot the following functions into a chart and a graph: the exponential function y =
ex , the logarithmic function y = ln x, hyperbolic cosine function y = cosh x and the cosine function y = cos x
for 0 x 5. Choose appropriate spacing to ensure smooth plot. Choose the appropriate scaling for the x
and y axes so that the user will have an idea on how the function behaves as x gets larger. Make sure also
that the user will be able to discern which plot is which. Finally, choose which is the better tool to plot such
functions so that the user will be able to use the plots for better understanding of the behavior of the
function. Call this VI as FunctionPlotter.vi.
2. (a) Generate a Gaussian distributed random number with a mean of 10 and a standard deviation of 2.
Page 4
ECE 100 Fundamentals of LabVIEW Programming
Your VI would only stop generating a random number when a Stop button is pressed. The VI should only
generate 100 data points per second. Plot the random numbers as they are generated and after pressing
the Stop button. Name the VI as WhiteNoise.vi. (b) A moving average filter is a kind of filter which aims to
smoothen out variations in signals. It works in the following manner: the current value and a number of
previous values are averaged to generate a new value. The number of values to be generated depends on
the window size of the filter. If for example, the window size is 10, then the current value plus 9 previous
values of the input signal are averaged. With this, create a moving average filter for the input signal
generated in part (a). The window size of the moving average filter is 5. Plot the input signal and the filtered
signal on the same set of axes. The VI should stop when a Stop button is pressed. Call this VI as the
MovingAverageFilter.vi. (Hint: Use shift registers.)
V. ASSESSMENT TASKS
1. What are the differences between a Waveform Graph and a Waveform Chart?
2. How do you differentiate Strip, Scope and Sweep chart update mode of a Waveform Chart?
4. Upon exploring the LabVIEW environment for Graphing, how do we do Surface and 3D plots?
Page 5
ECE 100 Fundamentals of LabVIEW Programming
VI. CONCLUSION
Page 6