1、音频信号发生器毕业设计论文翻译英文本科毕业设计(论文)外文翻译原文学生姓名: 何 晓 君 院 (系):电 子 工 程 学 院 专业班级: 测控0602班 指导教师: 薛 晓 书 完成日期:2010年4月20日 Expanding the Features of a VIYou can choose one of many LabVIEW VI templates to use as a starting point. However, sometimes you need to build a VI for which a template is not available. This cha
2、pter teaches you how to build and customize a VI without using a template.Building a VI from a Blank TemplateIn the following exercises, you will open a blank VI and add Express VIs and structures to theblock diagram to build a new VI. You will build a VI that generates a signal, reduces the number
3、of samples in the signal, and displays the resulting data in a table on the front panel. When you complete the exercises, the front panel of the VI will look similar to the front panel in Figure 3-1.You can complete the exercises in approximately 30 minutes. Figure 3-1. Front Panel for the Reduce Sa
4、mples VI Opening a Blank VIIf no template is available for the task you want to create, you can start with a blank VI and add Express VIs to accomplish the specific task. Complete the following steps to open a blank VI. 1. In the LabVIEW dialog box, click the arrow on the New button and select Blank
5、VI from the shortcut menu or press the keys to open a blank VI. Notice that a blank front panel and block diagram appear. Note You also can open a blank VI by selecting Blank VI from the Create new list in The New dialog box or by selecting FileNew VI from the front panel or block diagram menu bar.2
6、. If the Functions palette is not visible, right-click any blank space on the block diagram to bring up the temporary version of the Functions palette. Click the thumbtack, shown at left, in the upper left corner of the Functions palette to place the palette on the screen.Note You can right-click on
7、 a blank space on the block diagram or the front panel to bring up the Functions or Controls palettes.Adding an Express VI that Simulates a SignalComplete the following steps to find the Express VI you want to use and then add it to the block diagram.1. If the Context Help window is not visible, pre
8、ss the keys to open the Context Help window. You also can press the Show Context Help Window button, shown at left, to open the Context Help window.2. Select the Input palette on the Functions palette and move the cursor over the Express VIs on the Input palette.Notice that the Context Help window d
9、isplays information about the function of each Express VI.3. From the information provided in the Context Help window, find theExpress VI that can output a sine wave signal.4. Select the Express VI and place it on the block diagram. The Configure Simulate Signal dialog box appears.5. Idle the cursor
10、 over the various options in the Configure Simulate Signal dialog box, such as Frequency (Hz), Amplitude, and Samples per second (Hz). Read the information that appears in the Context Help window.6. Configure the Simulate Signal Express VI to generate a sine wave with a frequency of 10.7 and amplitu
11、de of 2.7. Notice how the signal displayed in the Result Preview window changes to reflect the configured sine wave.8. Close the Configure Simulate Signal dialog box.9. Move the cursor over the Simulate Signal Express VI and read the information that appears in the Context Help window.Notice that th
12、e Context Help window now displays the configuration of the Simulate Signal Express VI.10. Save this VI as Reduce Samples.vi to an easily accessible location.Modifying the SignalComplete the following steps to use the LabVIEW Help to search for the Express VI that reduces the number of samples in a
13、signal.1. Select HelpVI, Function, & How-To Help to open the LabVIEW Help.2. Click the Search tab and type sample compression in the Type in the word(s) to search for text box.Notice that this word choice reflects what you want this Express VI to docompress, or reduce, the number of samples in a sig
14、nal.3. Select the Sample Compression Express VI topic to display the topic that describes the Sample Compression Express VI.4. After you read the description of the Express VI, click the Place on the block diagram button, shown at left, to select the Express VI.5. Move the cursor to the block diagra
15、m.Notice how LabVIEW attaches the Sample Compression Express VI to the cursor.6. Place the Sample Compression Express VI on the block diagram to the right of the Simulate Signal Express VI.7. Configure the Sample Compression Express VI to reduce the signal by a factor of 25 using the mean of these v
16、alues.8. Close the Configure Sample Compression dialog box.9. Using the Wiring tool, wire the Sine output in the Simulate Signal Express VI to the Signals input in the Sample Compression Express VI.Customizing the Front PanelIn the previous exercises, you added controls and indicators to the front p
17、anel using the Controls palette. You also can add controls and indicators from the block diagram. Complete the following steps to create controls and indicators. 1. Right-click the Mean output in the Sample Compression Express VI and select CreateNumeric Indicator to create a numeric indicator.2. Ri
18、ght-click the Mean output of the Sample Compression Express VI and select Insert Input/Output from the shortcut menu to insert the Enable input.3. Right-click the Enable input and select CreateControl to create the Enable switch.4. Right-click the wire linking the Sine output in the Simulate Signal
19、Express VI to the Signals input in the Signal Compression Express VI and select CreateGraph Indicator.Notice that you can create controls and indicators from the block diagram. When you reate controls and indicators using this method, LabVIEW automatically creates terminals that are labeled and form
20、atted correctly.5. Using the Wiring tool, wire the Mean output in the Sample Compression Express VI to the Sine terminal. Notice that the Merge Signals function appears.6. Arrange the objects on the block diagram so that they appear similar to Figure 3-2.Tip You can right-click any wire and select C
21、lean Up Wire from the shortcut menu to have LabVIEW automatically arrange the wires for you.Figure 3-2. Block Diagram for the Reduce Samples VI7. Display the front panel.Notice that the controls and indicators you added automatically appear on the front panel with labels that correspond to their fun
22、ction.8. Save this VI.Configuring the VI to Run Continuously Until the User Stops ItIn the current state, the VI runs once, generates one signal, then stops executing. To run the VI until a condition is met, you can add a While Loop to the block diagram. Complete the following steps to add a While L
23、oop.1. Display the front panel and run the VI.Notice how the VI runs once and then stops. Also notice how there is no STOP button.2. Display the block diagram and select the While Loop on the Execution Control palette.3. Move the cursor to the upper left corner of the block diagram. Place the top le
24、ft corner of the While Loop here.4. Click and drag the cursor diagonally to enclose all the Express VIs and wires, as shown in Figure3-3.Figure 3-3. Placing the While Loop around the Express VIsNotice that the While Loop, shown at left, appears with a STOP button wired to the condition terminal. Thi
25、s While Loop is configured to stop when the user clicks the STOP button.5. Display the front panel and run the VI.Notice that the VI now runs until you click the STOP button. A While Loop executes the functions inside the loop until the user presses the STOP button.Controlling the Speed of Execution
26、To plot the points on the waveform graph more slowly, you can add a time delay to the block diagram. Complete the following steps to control the speed at which the VI executes.1. On the block diagram, select the Time Delay Express VI on the Execution Control palette and place it inside the loop.2. T
27、ype .250 in the Time delay (seconds) text box.This time delay specifies how fast the loop runs. With a .250 second time delay, the loop iterates once every quarter of a second.3. Close the Configure Time Delay dialog box.4. Save this VI.5. Display the front panel and run the VI.6. Click the Enable s
28、witch and notice the change on the graph.Notice how if the Enable switch is on, the graph displays the reduced signal. If the Enable switch is off, the graph does not display the reduced signal.7. Click the STOP button to stop the VI.Using a Table to Display DataComplete the following steps to displ
29、ay a collection of mean values in a table on the front panel.1. On the front panel, select the Express Table indicator on the Text Indicators palette and place it on the front panel to the right of the waveform graph.2. Display the block diagram.Notice that the Table terminal appears wired to the Bu
30、ild Table Express VI automatically.3. If the Build Table Express VI and the Table terminal are not selected already, click an open area on the block diagram to the left of the Build Table Express VI and the Table terminal. Drag the cursor diagonally until the selection rectangle encloses the Build T
31、able Express VI and the Table terminal, shown at left. A moving dashed outline called a marquee highlights the Build Table Express VI, the Table terminal, and the wire joining the two.4. Drag the objects into the While Loop to the right of the Mean terminal.Notice that the While Loop automatically r
32、esizes to enclose the Build Table Express VI and the Table termial.5. Using the Wiring tool, wire the Mean terminal of the Sample Compression Express VI to the Signals input of the Build Table Express VI.The block diagram should appear similar to Figure 3-4.Figure 3-4. Block Diagram of the Reduce Samples VI6. Display the front panel and run the VI.7. Click the Enable switch.The table displays the mea
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1