Chapter 3 Analyzing and Saving a Signal

Steps to create a VI that generates, analyzes, and displays a signal.

1. In the Getting Started window, click New to display the New dialog box.
2. From the Create New list, select VI»From Template»Tutorial (Getting Started)»Generate, Analyze,     and Display. This template VI simulates a signal and analyzes it for its root mean square (RMS)
    value.
3. Click the OK button or double-click the name of the template to create a VI from the template.
4. If the Context Help window is not visible, press the <Ctrl-H> keys to display the window. (Mac         OS X) Press the <Command-Shift-H> keys.
5. Display the block diagram by pressing the <Ctrl-E> keys.
6. Move the cursor over the Amplitude and Level Measurements Express VI, shown at left.
7. Display the front panel and remove the RMS indicator, shown at left.
8. Display the block diagram and remove any broken wires that result from removing the RMS               indicator. To remove all broken wires from the block diagram, you can press the <Ctrl-B> keys.
9. Then return to the front panel window and right-click the waveform graph indicator. Select                 Properties from the shortcut menu. The Graph Properties dialog box appears.
10. On the Appearance page, place a checkmark in the Visible checkbox in the Label section and              enter Unfiltered Signal in the text box.
11. Click the OK button to save the configuration and close the Graph Properties dialog box.
12. Run the VI. The signal appears in the graph.
13. Click the STOP button to stop the VI.

Adding a signal
1. Double-click the Simulate Signal2 Express VI to display the Configure Simulate Signal dialog box.
2. Select Sine from the Signal type pull-down menu.
3. Enter 60 in the Frequency (Hz) text box.
4. Enter 0.1 in the Amplitude text box.
5. Place a checkmark in the Add noise checkbox to add noise to the sine
signal.
6. Select Uniform White Noise from the Noise type pull-down menu.
7. Enter 0.1 in the Noise amplitude text box.
8. Enter -1 in the Seed number text box.
9. In the Timing section, select the Run as fast as possible option.
10. In the Signal Name section, remove the checkmark from the Use
signal type name checkbox.

11. Enter 60 Hz and Noise in the Signal name text box.

Configure simulate signal dialog box
1. Display the block diagram window and remove the wire that connects the Result output of the             Formula Express VI to the Signals input of the Amplitude and Level Measurements Express VI.
2. Remove all broken wires that result from removing the wire.
3. Search for the Filter Express VI, shown at left, and add it to the block diagram between the                 Simulate Signal2 Express VI and the Amplitude and Level Measurements Express VI. The                 Configure Filter dialog box appears.
4. In the Filter Specifications section, change the Cutoff Frequency (Hz) to 25.
5. Click the OK button to save the configuration and close the Configure Filter dialog box.
6. Display the front panel.
7. Click the Unfiltered Signal waveform graph indicator and press the <Ctrl> key while you drag with    the Positioning tool to create an additional waveform graph indicator.
8. Triple-click the Unfiltered Signal 2 label above the new waveform graph indicator and enter
    Filtered Signal to change the label of the indicator. You also can change the label on the                       Appearance page of the Graph Properties dialog box.
9. On the block diagram, wire the Result output of the Formula Express VI to the Signal input of the       Filter Express VI and to the Unfiltered Signal waveform graph indicator.
10. Wire the Filtered Signal output of the Filter Express VI to the Signals input of the Amplitude and      Level Measurements Express VI and to the input of the Filtered Signal waveform graph indicator.
11. Select File»Save.
Block diagram of the analysis VI
After you specify the values at which you want the LED to light, you must
wire the LED to the Greater Express VI.
1. In the block diagram window, move the Warning terminal to the right of the Greater Express VI.         Make sure the Warning terminal is inside the While Loop
Block diagram of the Warning Light VI






2. Wire the Result output of the Greater Express VI to the Warning
terminal.

Saving Data When Prompted by a User
1. In the block diagram window, double-click the Write To Measurement File Express VI to display       the Configure Write To Measurement File dialog box.
2. Change the filename test.lvm in the Filename text box to Selected Samples.lvm to save the data to       a different file.
3. Click the OK button to save the current configuration and close the Configure Write To                       Measurement File dialog box.
4. Right-click the Signals input of the Write To Measurement File Express VI and select Insert                 Input/Output from the shortcut menu to insert the Comment input.
5. Right-click the Comment input of the Write To Measurement File Express VI and select Select           Input/Output»Enable from the shortcut menu to replace the Comment input with the Enable input.
6. Move the Write to File terminal to the left of the Write To Measurement File Express VI.
7. Wire the Write to File terminal to the Enable input of the Write To Measurement File Express VI.
Block diagram of the save data VI
Steps to view the data that you save to the Selected Samples.lvm file
1. Display the front panel and run the VI. Click the Write to File button several times.
2. Click the STOP button.
3. Open the Selected Samples.lvm file with a spreadsheet or text-editing application.
4. Close the file after you finish looking at it.
5. Save and close the VI.




Post a Comment

Copyright © Medical Instrumentation (LABVIEW). Blogger Templates Designed by OddThemes