• No results found

Activity 6-Graphing in LabVIEW.docx

N/A
N/A
Protected

Academic year: 2021

Share "Activity 6-Graphing in LabVIEW.docx"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

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.

(2)

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 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. Provide also a Numerical Indicator above the displays.

(3)

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?

Question: Why is that the iteration condition is set to 200×pi? 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?

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

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

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

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

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

(4)

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?

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.

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

(5)

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?

(6)

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

(7)

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.

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 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?

Page 50

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.

Waveform graphs and Waveform charts differ in the way they display and update data.

-A Waveform Graph accepts arrays of data in various forms, e.g. array, waveform, or dynamic data. It then plots all the received points at once. It does not accept single point values. When an array of points is wired to a waveform graph, it assumes the points are equally spaced out. By default, the starting X value and step size (t0 and dt) are 0 and 1 respectively. This can be changed in the properties of the graph or using property nodes.

-The waveform data type is essentially an array of points that also contains t0 and dt information. In this case, the waveform graph 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

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

(8)

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

(9)

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

(10)

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

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.

References

Related documents

Combining Properties and Evidence to Support Overall Confor- mance Claims: Safety-critical system development increasingly relies on using a diverse set of verification

Notice of this Application and Hearing on the Application shall be given by certified mail return receipt requested to Decedent's surviving spouse, to all persons entitled to inherit

Request approval to 1) accept a grant award from, and enter into a grant agreement with, the American Psychological Association Board of Educational Affairs to pursue accreditation

The State of California, Department of Insurance (CDI) has awarded the District Attorney¶s Office (DA) $4,700,955 for the Automobile Insurance Fraud (AIF) Program, $2,121,829 for

If you’re a beer buff, take a guided tour at Deschutes Brewery to learn more about how the craft beer scene got its start in Central Oregon, then visit a few.. of the city’s

The existing Inlet Closed Drain Drum has been designed taking into consideration of the following criteria:. - Closed Drain Drum is a

Dieckmann, Enhancing Resilience of Systems to Individual and Systemic Risk: Steps toward An Integrative Framework, International Journal of Disaster Risk Reduction,

The history of the village in the Old Order must not be separated from political power system constructed to derive Maliki’s central government (1999)-When the count- ry