Documentos de Académico
Documentos de Profesional
Documentos de Cultura
GRAPHING IN LABVIEW
Activity No. 6
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.
Page 44
ECE 100 Fundamentals of LabVIEW Programming
1. You will be plotting a sinusoidal waveform y=sin x for 0 x 2 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.
Page 45
ECE 100 Fundamentals of LabVIEW Programming
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?
The 200xpi is for the slope of the graph so that the VI show the a curve with
respect with x and y axis 200xpi Because it is a values that can be more
appropriate to the VI so that the VI run with no delusion and entangled graph
lines
Question: What is the purpose of Wait until ms function inside the For-loop structure?
Values of the millisecond timer becomes a multiple of the specified millisecond multiple
use this function to synchronize activities you can call this function is in a loop to control
the loop execution rate
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?
It cant be goes inside of the for loop structure and connect It to the output
terminal of the sin function the wire will be broken and state that the task is not
appropriate
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
Page 46
ECE 100 Fundamentals of LabVIEW Programming
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.
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.
The VI run as the same as the constant values of it but if you updated the chart
every run there was a big difference in the line animation. it so the VI shown the
same result as the answer in the following chart update
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 47
ECE 100 Fundamentals of LabVIEW Programming
I customize my plot animation to diamond plot and thicker lines and for the color I choose blue and
green as I customize by graph and horizontally joint points
ACTIVITY 6.3:
MULTIPLE PLOTS
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?
Page 48
ECE 100 Fundamentals of LabVIEW Programming
Step 1: put the waveform chart: font panel right click-waveform properties drag to the font panel
Step 2: put the waveform graph: font panel right click waveform graph drag to the font panels
Step 3: put the indicator sine and cosine rename as sine and cosine x
Step 4: put the for loop sine and cosine functuio. Wait ms until next ms multiple , multiple, divide,
and constant
Step 5: Arrange the block diagram and RUN the Vi and the result will shown
The VI Run at it is indicate in the constant values shown in the block diagram and the result shown
in the font panel. I used bundle cluster to Replaces one or more elements. This function refers to
Page 49
ECE 100 Fundamentals of LabVIEW Programming
elements by name instead of by their position in the VI then I used Build array function to operates
in one of two elements that can be issuance of result
Question: What function did you use to superimpose two plots in a single chart or graph? Explain
this function.
Cluster Bundle - Assembles a cluster from individual elements.
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.
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 Waveform graphs
Stop button. Name theand
VI asWaveform
WhiteNoise.vi.charts
(b) Adiffer
movinginaverage
the way
filterthey display
is a kind of filterand update
which aims to
data. out variations in signals. It works in the following manner: the current value and a number of
smoothen
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
-A Waveform
values of the input Graph
signal areaccepts arrays
averaged. With of data
this, in various
create a movingforms,
averagee.g. filterarray,
for thewaveform,
input signal
generated in part (a). The window size of the moving average filter is 5. Plot the input signalnot
or dynamic data. It then plots all the received points at once. It does and accept
the filtered
signal on the same set of axes. The VI should stop when a Stop button is pressed. Call this VIit as the
single point values. When an array of points is wired to a waveform graph,
assumes the points
MovingAverageFilter.vi. areUse
(Hint: equally spaced out. By default, the starting X value and
shift registers.)
step size (t0 and dt) are 0 and 1 respectively. This can be changed in the
V. ASSESSMENT
properties ofTASKS
the graph or using property nodes.
-The waveform data type is essentially an array of points that also contains
1. What are the
t0 and dtdifferences between
information. In athis
Waveform
case, Graph and a Waveform
the waveform graphChart?
receives the t0 and dt
contained within the waveform and displays the data accordingly. You can build
your own waveform with data points, t0, and dt specified. You can also display
multiple plots on the same waveform graph by wiring a 2D array to the graph.
-A Waveform Chart remembers and displays a certain number of points by storing
them in a buffer. When the buffer gets full, the chart starts overwriting the oldest
points with new ones. As the data points become available, the chart displays
received data in addition to already existing points. You can write single or
Page 50
multiple data points to it at once. If we wire an array of points to the chart, it will
append those points to the existing ones. You can display multiple plots on the
same chart by wiring in a cluster or a 2D array containing data for each plot. For
example, if you wire in a cluster of 3 points, one point will be added to each of
ECE 100 Fundamentals of LabVIEW Programming
2. How do you differentiate Strip, Scope and Sweep chart update mode of a Waveform Chart?
There are 3 update modes when it comes to XY/ Waveform Charts. What
do these update modes mean and how do they differ? This example
demonstrates the differences between these chart update mode types
Strip Chart: This mode has a scrolling display that is similar to a paper
tape strip chart recorder. As it receives each new value, it plots the value
at the right margin, and shifts old values to the left.
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
Page 51
ECE 100 Fundamentals of LabVIEW Programming
Page 52
ECE 100 Fundamentals of LabVIEW Programming
4. Upon exploring the LabVIEW environment for Graphing, how do we do Surface and 3D plots?
VI. CONCLUSION
In this activity I acquired the ability to use charts and graph in national instrument labview this
option are capable to condense large amounts of information into easy-to understand formats that
clearly and effectively communicate important points that can be shown in the output result in VI.
Then after the consequence of the chart and graph I determine the uses of the function of every
control that include in the chart and graph. It includes strip chart that continues to plot new point,
scope chart that it erase the plot and begins plotting again form the left boarder and lastly sweep
chart that moving vertical line mark the beginning of new data and move across. And by using this
option of programing I can create a 2D or 3D figure in a single VI by the help of some arithmetic
equation and formula.
VII. RUBRICS FOR LABORATORY PERFORMANCE
Page 53