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 LabVIEW’s 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.
• 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.

Page 44

right click anywhere in Front Panel and choose ControlsModernGraphWaveform Chart. To access Waveform Graph. right click anywhere in Front Panel and choose ControlsModernGraphWaveform Graph. Page 45 . LEARNING ACTIVITIES ACTIVITY 6. You will be plotting a sinusoidal waveform y=sin x for 0 ≤ x ≤ 2 π using a Waveform Chart and a Waveform Graph.1: DISPLAYING CHART AND GRAPH 1.ECE 100 Fundamentals of LabVIEW Programming III. Create a Front Panel and Block Diagram as shown. Provide also a Numerical Indicator above the displays.VI To access Waveform Chart. Save your VI as Act6_1_1.

ECE 100 Fundamentals of LabVIEW Programming 3. The chart and graph can be configured using the Property dialog box. 4.VI Page 46 . Outside the For-loop structure. You are about to modify the last saved VI from Activity 6. Waveform Chart. put a Multiply function on the Iteration condition. sin function. To put a constant pi.1. right click anywhere in the Block Diagram and choose FunctionsProgrammingNumericMath ConstantsPi. On the Block diagram. It is start with a values in sine then values in constant that can be shown in the waveform chart that goes to the waveform graph as it is final answer Question: Why is that the iteration condition is set to 200×pi? 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 can’t 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 ACTIVITY 6. Save this VI as Act6_2_1. N by dividing 200 to a constant pi.2: CONFIGURING CHART AND GRAPH 1. drag and drop a For-loop structure and put inside the following objects: Wait until ms set to 25. Question: How does the VI work? The Vi running base on the structure in the block diagram and indicate constant values. and the Numeric Indicator.

right click on the Waveform Chart and choose PropertiesUpdate modeSelect Sweep chart and then run the VI. Page 47 . When the plot reaches the right border of the plotting area. Instead. Right click on the Waveform Chart and choose PropertiesUpdate modeSelect Scope chart and then run the VI. And then after running in the Scope Chart mode. a moving vertical line marks the beginning of new data and moves across the display from left to right as it adds new data. Scope Chart: This mode has a retracing display similar to an oscilloscope. 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. Question: How do we visually customize our charts and graphs to make it presentable? Explain it in a procedural manner. This mode first plots values from left to right. Scope chart and Sweep chart as the update mode? Are these updates available for Waveform Graph? Why or why not? Strip Chart: This mode has a scrolling display that is similar to a paper tape strip chart recorder. Explore the Property dialog box of the Charts and Graphs and customize your plots. 3. it erases the plot and begins plotting again from the left border.ECE 100 Fundamentals of LabVIEW Programming 2. SCREEN- CAPTURE your graphs and charts and include it in your activity report. but the plot is not erased when the plot hits the right border. it plots the value to the right of the last value. it so the VI shown the same result as the answer in the following chart update 4. Sweep Chart: This mode acts much like the scope chart. As it receives each new value. From here. it continues to plot new points at the rightmost point and shifts old values to the left. Do procedure 2 for the Waveform Graph. Question: What happens to the Waveform Chart as you use the Strip chart.

Save your VI as Act6_3_1. Create a VI with the following Front Panel and Block Diagram as shown.VI The FP shows graphical display of sin(x) and cos(x).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. Do a mini-procedure on how you obtain the plots above? Page 48 . Question: Explain in a systematic manner how did you come up with the Front panel and Block Diagram shown above.3: MULTIPLE PLOTS 1.

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. 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. Wait ms until next ms multiple . This function refers to Page 49 . divide. multiple. I used bundle cluster to Replaces one or more elements.

It then plots all the received points at once. Make sure also that the user will be able to discern which plot is which. 2. By default. For example. Create a VI that would plot the following functions into a chart and a graph: the exponential function y = ex . 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. Call this VI as FunctionPlotter. the function appends all inputs in order. t0. input signal generated in part (a). Name theand VI asWaveform WhiteNoise.g. if you wire in a cluster of 3 points. assumes the points MovingAverageFilter. You can display multiple plots on the same chart by wiring in a cluster or a 2D array containing data for each plot. The number of values to be generated depends on the window size of the filter. Choose appropriate spacing to ensure smooth plot.) step size (t0 and dt) are 0 and 1 respectively.vi. one point will be added to each of . The VI should only generate 100 data points per second. If for example. areUse (Hint: equally spaced out. then the current value plus 9 previous -A Waveform values of the input Graph signal areaccepts arrays averaged. -The waveform data type is essentially an array of points that also contains 1. -A Waveform Chart remembers and displays a certain number of points by storing them in a buffer. the chart displays received data in addition to already existing points.Assembles a cluster from individual elements.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.charts (b) Adiffer movinginaverage the way filterthey display is a kind of filterand update which aims to data. The VI should stop when a Stop button is pressed. hyperbolic cosine function y = cosh x and the cosine function y = cos x for 0 ≤ x ≤ 5. With of data this. the starting X value and shift registers. It works in the following manner: the current value and a number of smoothen previous values are averaged to generate a new value. What are the t0 and dtdifferences between information. and dt specified. Cluster Bundle . the window size is 10. 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. Finally. ASSESSMENT properties ofTASKS the graph or using property nodes. the logarithmic function y = ln x. Call this VIit as the single point values. forming an output array of the same dimensionality as the array input wired. You can also display multiple plots on the same waveform graph by wiring a 2D array to the graph. When an array of points is wired to a waveform graph. Plot the input signalnot or dynamic data. Your VI would only stop generating a random number when a Stop button is pressed. filterarray. (a) Generate a Gaussian distributed random number with a mean of 10 and a standard deviation of 2.vi. MACHINE PROBLEM 1. The window size of the moving average filter is 5. When the buffer gets full. it will append those points to the existing ones. IV. out variations in signals. If we wire an array of points to the chart. You can build your own waveform with data points. Plot the random numbers as they are generated and after pressing the Waveform graphs Stop button. in various create a movingforms. the chart starts overwriting the oldest points with new ones.vi. It does and accept the filtered signal on the same set of axes. You can write single or Page 50 multiple data points to it at once. If you select Concatenate Inputs. As the data points become available. averagee. 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. The Build Array function operates in one of two modes depending on whether you select Concatenate Inputs from the shortcut menu. for thewaveform. This can be changed in the V.

ECE 100 Fundamentals of LabVIEW Programming 2. it plots the value at the right margin. Instead. When the plot reaches the right border of the plotting area. a moving vertical line marks the beginning of new data and moves across the display from Page 51 . As it receives each new value. it erases the plot and begins plotting again from the left border. 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. Scope and Sweep chart update mode of a Waveform Chart? There are 3 update modes when it comes to XY/ Waveform Charts. Scope Chart: This mode has a retracing display similar to an oscilloscope. As it receives each new value. and shifts old values to the left. Sweep Chart: This mode acts much like the scope chart. it plots the value to the right of the last value. How do you differentiate Strip. but the plot is not erased when the plot hits the right border.

State the importance of plotting data in LabVIEW.ECE 100 Fundamentals of LabVIEW Programming 3.  To visualize the result in the VI as it shown in the graph or chart form  To made a VI by yourself easy to interpret the data given in the VI Page 52 .

It includes strip chart that continues to plot new point. VII. Upon exploring the LabVIEW environment for Graphing. A curve is ideal for visualizing the path of a moving object. how do we do Surface and 3D plots? Use the 3D Surface. 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. 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 3D Curve graphs in conjunction with the 3D Graph Properties dialog box to plot curves and surfaces.ECE 100 Fundamentals of LabVIEW Programming 4. A curve contains individual points on the graph. RUBRICS FOR LABORATORY PERFORMANCE Page 53 . 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. such as the flight path of an airplane. The following illustration shows an example of a 3D Line Graph and is similar to the ActiveX 3D Curve Graph. and z coordinate. 3D Parametric. each point having an x. y. The VI then connects these points with a line. VI. 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.