Sunteți pe pagina 1din 6

ECE 100 Fundamentals of LabVIEW Programming

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.

II. BACKGROUND INFORMATION

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.

These chart and graph


indicators are available on the
controls palette. Waveform chart
and waveform graphs differ
by the manner they can display
and update data. A waveform chart
remembers and displays a certain
number of points by storing these
points in a buffer. When the buffer gets full, the chart starts overwriting the old values with the new ones.
When new data points become available, they are appended to the old ones. Waveform charts are used to
display real-time data points, though it also accepts arrays and displays the points all at once. A waveform
graph however, accepts array as an input and displays these as data points all at once. It does not accept
single value points. It is assumed that the points in the array are equally spaced when they are accepted as
an input to a waveform graph.

A waveform chart has three update modes:


Strip Chart: This mode has a scrolling display that is similar to a paper tape strip chart
recorder. This mode first plots values from left to right. From here, it continues to plot
new points at the rightmost point and shifts old values to the left.

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.

III. LEARNING ACTIVITIES

ACTIVITY 6.1: DISPLAYING CHART AND GRAPH

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: How does the VI work?

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

ACTIVITY 6.2: CONFIGURING CHART AND GRAPH

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.

3. Do procedure 2 for the Waveform Graph.


Question: What happens to the Waveform Chart as you use the Strip chart, Scope chart and Sweep
chart as the update mode? Are these updates available for Waveform Graph? Why or why not?

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

ACTIVITY 6.3: MULTIPLE PLOTS

1. Create a VI with the following Front Panel and Block Diagram as shown. Save your VI as Act6_3_1.VI

The FP shows graphical display of sin(x) and cos(x).

Question: Explain in a systematic manner how did you come up with


the Front panel and Block Diagram shown above. Do a mini-procedure
on how you obtain the plots above?

Question: What function did you use to superimpose two plots in a single chart or graph? Explain
this function.

IV. MACHINE PROBLEM

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?

3. State the importance of plotting data in LabVIEW.

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

VII. RUBRICS FOR LABORATORY PERFORMANCE

Page 6

S-ar putea să vă placă și