Showing posts with label labview. Show all posts
Showing posts with label labview. Show all posts

Wednesday, August 18, 2010

Tip - Express VIs and Waveform Types

For those who are using Express VIs to do data acquisition, you will often find that you get a thick purple wire and may find it difficult to work with. You would rather have the usual floating point (orange) array of data points so you can use the standard array VIs to manipulate data and pull single points from the data.

It turns out that there is a waveform menu:
The "Get Waveform Components" element at the upper left corner of the menu in this image allows you to unbundle information from the waveform data type much like unbundling from a cluster. When first placed on the block diagram it will look like the following (with a waveform wired in):

The Y output is the desired floating point array. However, if the time information for the waveform is desirable, you must expand this element at the top in an upward direction. This is done by hovering over the top edge until the cursor indicates you can drag to expand. When this is done, you can expand two elements above the Y as shown below:
Now the initial time and the delta time per point are available. The waveform type contains evenly spaced data points, so a single dt point is all that is available.

At a minimum, using the Y terminal provides an indexable array. To produce X-Y plots, you can run the Y array in autoindexing fashion, through a for loop. Use the index terminal inside the for loop and multiply its value by dt for each iteration. This can be wired to an autoindexing output to generate an array of X values corresponding to Y values:


Rather than wire the corresponding X and Y arrays to indicator terminals, you can continue to operate on the arrays in whatever manner is necessary for your application. These two arrays can be bundled into a cluster and wired to the terminal for an XY Graph Indicator. They can also be operated upon with the usual index array and array subset VIs under the Array menu.

Exercise 0 - Open and Run a Virtual Instrument

Examine the Signal Generation and Processing VI and run it. Change the frequencies and types of the input signals and notice how the display on the graph changes. Change the Signal Processing Window and Filter options. After you have examined the VI and the different options you can change, stop the VI by pressing the Stop button.

1. Select Start»Programs»National Instruments»LabVIEW 7.0»LabVIEW to launch LabVIEW. The LabVIEW dialog box appears.

2. Select Help»Find Examples. The dialog box that appears lists and links to all available LabVIEW example VIs.

3. On the Browse Tab, select browse according to task. Choose Analyzing and Processing Signals, then Signal Processing, then Signal Generation and Processing.vi.
This will open the Signal Generation and Processing VI Front Panel.

Note You also can open the VI by clicking the Open VI button and navigating to
labview\examples\apps\demos.llb\Signal Generation and Processing.vi.

Front Panel
            4. Click the Run button on the toolbar, shown at left, to run this VI.
This VI determines the result of filtering and windowing a generated signal. This example also displays the power spectrum for the generated signal. The resulting
signals are displayed in the graphs on the front panel, as shown in the
following figure.

5. Use the Operating tool, shown at left, to change the Input Signal and the Signal Processing, use the increment or decrement arrows on the control, and drag the pointer to the desired Frequency.

6. Press the More Info… button or [F5] to read more about the analysis functions.

7. Press the Stop button or [F4] to stop the VI.





Block Diagram

8. Select Window»Show Diagram or press the <Ctrl-E> keys to display
the block diagram for the Signal Generation and Processing VI.

(MacOS) Press the <Command-E> keys. (Sun) Press the <Meta-E> keys.
(Linux) Press the <Alt-E> keys.

This block diagram contains several of the basic block diagram elements, including subVIs, functions, and structures, which you will learn about later in this course.

9. Select Window»Show Panel or press the <Ctrl-E> keys to return to the Front Panel.

10.  Close the VI and do not save changes.


End of Exercise

Related Posts Plugin for WordPress, Blogger...

Popular Projects

My Blog List

Give support

Give support
Encourage Me through Comments & Followers

Followers