Activity 6-Graphing in LabVIEW.docx

October 6, 2017 | Author: ALlan ABiang | Category: Chart, Trigonometric Functions, Function (Mathematics), Areas Of Computer Science, Mathematics
Share Embed Donate


Short Description

Download Activity 6-Graphing in LabVIEW.docx...

Description

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

ECE 100 Fundamentals of LabVIEW Programming III. LEARNING ACTIVITIES ACTIVITY 6.1: DISPLAYING CHART AND GRAPH 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 ControlsModernGraphWaveform Chart.

in

Front

Panel

and

choose

To access Waveform Graph, right click anywhere in Front Panel and choose ControlsModernGraphWaveform 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 FunctionsProgrammingNumericMath ConstantsPi. Question: How does the VI work? The Vi running base on the structure in the block diagram and indicate constant values. 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.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 Page 46

ECE 100 Fundamentals of LabVIEW Programming 2. 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, right click on the Waveform Chart and choose PropertiesUpdate modeSelect 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? 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. 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. SCREENCAPTURE 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 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?

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.

The Build Array function operates in one of two modes depending on whether you select Concatenate Inputs from the shortcut menu. If you select Concatenate Inputs, the function appends all inputs in order, forming an output array of the same dimensionality as the array input wired. 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. 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 graphs charts the way display update the Waveform Stop button. Name theand VI asWaveform WhiteNoise.vi. (b) Adiffer movinginaverage filterthey is a kind of filterand 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 accepts arrays data in various values of the input Graph signal are averaged. With of this, create a movingforms, averagee.g. filterarray, for thewaveform, input signal or dynamic data. It then plots all the received points at once. It does generated in part (a). The window size of the moving average filter is 5. Plot the input signalnot and accept the filtered single point values. When an array of points is wired to a waveform graph, signal on the same set of axes. The VI should stop when a Stop button is pressed. Call this VIit as the assumes the points areUse equally spaced out. By default, the starting X value and MovingAverageFilter.vi. (Hint: 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 between Waveform and a Waveform t0 and dtdifferences information. In athis case, Graph 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. 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

Page 51

ECE 100 Fundamentals of LabVIEW Programming

3. State the importance of plotting data in LabVIEW.  

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

ECE 100 Fundamentals of LabVIEW Programming 4. Upon exploring the LabVIEW environment for Graphing, how do we do Surface and 3D plots? Use the 3D Surface, 3D Parametric, and 3D Curve graphs in conjunction with the 3D Graph Properties dialog box to plot curves and surfaces. A curve contains individual points on the graph, each point having an x, y, and z coordinate. The VI then connects these points with a line. A curve is ideal for visualizing the path of a moving object, 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.

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

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF