Labview Exp 1
Labview Exp 1
Aim : To build a VI that generate a signal and displays that signal in a graph Output : After finishing the experiment the front panel should look like this.
PROCEDURE:
STEP #1 Launching Labview
1) Getting started window will appear when you launch the lab view.
From the getting started window you can open an existing VI or a new VI 2) opening a new VI from a template Labview provides build in template VIs that includes sub Vis, functions, structures and front panel objects. Steps to create a VI that generate a signal and displays it in the front panel window 1) Launch Labview 2) In the getting started window , click the New or VI from template link to display the New dialog box. 3) From the Create New list , Select VI>>From Template>>Tutorial>>Generate and Display .
4) Click the OK button to create a VI from template . After this Labview displays two windows a) Front panel window b) Block Diagram window 5) Examine the front panel window. The front panel appears with a gray background and includes controls and indicators 6) Select window>>Show Block Diagram and examine the block diagram of the VI The block diagram appears with a white background and includes Vis and structures that control the front panel objects . 7) On the front panel toolbar click the Run button . A sine wave appears on the graph in the front panel window. 8) Stop the VI by clicking the front panel STOP button.
Front panel controls simulate the input mechanism on a physical instrument and supply data to the block diagram of the VI . Ex : Steps to add a knob control to the front panel. 1) If the control palette as shown in the below figure is not visible in the front panel window , then select View>> Controls Palette.
2) If you are new Lab view user , the control palette opens with the Express palette. If you do not see the Express palette, click Express on the Controls palette to display the Express palette. 3) Move the cursor over the icons on the Express palette to locate the Numeric Control palette . When you move the cursor over the icons on the control palette , the name of subpalette , control, or indicators in a tip strip below the icon. 4) Click the Numeric Controls icon to display the Numeric Controls palette. 5) Click the Knob control on the Numeric Controls palette to attach the control to the cursor, and then add the knob to the front panel to the left of the waveform graph. 6) select File >>Save As and save the VI < STEP # 3: Changing a Signal Type The block diagram has a blue icon labeled Simulate Signal. This icon represents the Simulate Signal Express VI. An Express VI is a component of the block diagram that you can configure to perform common measurement tasks. The Simulate Signal Express VI simulates a sine wave by default. >.vi .
Complete the following steps to change this signal to a sawtooth wave. 1. Display the block diagram by pressing the <Ctrl-E> keys or by clicking the block diagram. Locate the Simulate Signal Express VI, shown at left. The Simulate Signal Express VI simulates a signal based on the configuration that you specify. 2. Right-click the Simulate Signal Express VI and select Properties from the shortcut menu to display the Configure Simulate Signal dialog box. 3. Select Sawtooth from the Signal type pull-down menu. The waveform on the graph in the Result Preview section changes to a sawtooth wave.
4. Click the OK button to save the current configuration and close the Configure Simulate Signal dialog box. 5. Move the cursor over the down arrows at the bottom of the Simulate Signal Express VI. The down arrows indicate you can reveal hidden inputs and outputs by extending the border of the Express VI. 6. When a double-headed arrow appears, shown at left, click and drag the border of the Express VI to add two rows. When you release the border, the Amplitude input appears. STEP # 4: Wiring Objects on the Block Diagram
To use the knob to change the amplitude of the signal, you must connect two objects on the block diagram. Complete the following steps to wire the knob to the Amplitude input of the Simulate Signal Express VI. 1. On the block diagram, move the cursor over the Knob terminal. The cursor becomes an arrow, or the Positioning tool. Use the Positioning tool to select, position, and resize objects. 2. Use the Positioning tool to select the Knob terminal and make sure it is to the left of the Simulate Signal Express VI and inside the gray loop. The terminals inside the loop are representations of front panel controls and indicators. Terminals are entry and exit ports that exchange information between the front panel and block diagram. 3. Deselect the Knob terminal by clicking a blank space on the block diagram. If you want to use a different tool with an object, you must deselect the object to switch the tool. 4. Move the cursor over the arrow on the Knob terminal, shown at left. The cursor becomes a wire spool, or the Wiring tool, shown at left. Use the Wiring tool to wire objects together on the block diagram. 5. When the Wiring tool appears, click the arrow on the Knob terminal and then click the arrow on the Amplitude input of the Simulate Signal Express VI, shown at left, to wire the two objects together. A wire appears and connects the two objects. Data flows along this wire from the Knob terminal to the Express VI. 6. Select FileSave to save the VI.
STEP # 5 : Running a VI Complete the following steps to run the Acquiring a Signal VI. 1. Display the front panel by pressing the <Ctrl-E> keys or by clicking the front panel. 2. Click the Run button or press the <Ctrl-R> keys to run the VI. 3. Move the cursor over the knob. The cursor becomes a hand, or the Operating tool, shown at left. Use the Operating tool to change the value of a control.
4. Using the Operating tool, turn the knob to adjust the amplitude of the sawtooth wave. The amplitude of the sawtooth wave changes as you turn the knob. As you change the amplitude, the Operating tool displays a tip strip that indicates the numeric value of the knob. The y-axis on the graph scales automatically to account for the change in amplitude. To indicate that the VI is running, the Run button changes to a darkened arrow. You can change the value of most controls while a VI runs, but you cannot edit the VI in other ways while the VI runs. 5. Click the STOP button, shown at left, to stop the VI. The STOP button stops the VI after the loop completes its current iteration. The Abort Execution button, shown at left, stops the VI immediately, before the VI finishes the current iteration. Aborting a VI that uses external resources, such as external hardware, might leave the resources in an unknown state by not resetting or releasing them properly. Design the VIs you create with a stop button to avoid this problem.