P6 Tutorial LABVIEW
P6 Tutorial LABVIEW
1
Virtual Instruments
LabVIEW programs are called virtual instruments, or VIs, because
their appearance and operation imitate physical instruments, such as
oscilloscopes and multimeters. LabVIEW contains a comprehensive set of
tools for acquiring, analyzing, displaying, and storing data, as well as tools
to help you troubleshoot your code.
In LabVIEW, you build a user interface, or front panel, with controls and
indicators. Controls are knobs, push buttons, dials, and other input devices.
Indicators are graphs, LEDs, and other displays. After you build the user
interface, you add code using VIs and structures to control the front panel
objects. The block diagram contains this code.
4. Click the OK button to open the template. You also can double-click
the name of the template VI in the Create new list to open the
template.
NoteIf the block diagram is not visible, you can display the block diagram by selecting
Window»Show Block Diagram.
7. In the front panel toolbar, click the Run button, shown at left.
Notice that a sine wave appears on the graph.
8. Stop the VI by clicking the STOP button, shown at left, on the front
panel.
Tip Throughout these exercises, you can undo recent edits by selecting Edit»Undo or
pressing the <Ctrl-Z> keys.
1. If the Controls palette, shown in Figure 1-4, is not visible on the front
panel, select Window»Show Controls Palette to display it.
2. Move the cursor over the icons on the Controls palette to locate the
Numeric Controls palette.
Notice that when you move the cursor over icons on the Controls
palette, the name of that subpalette appears in the gray space above all
the icons on the palette. When you idle the cursor over any icon on any
palette, the full name of the subpalette, control, or indicator appears.
3. Click the Numeric Controls icon to access the Numeric Controls
palette.
4. Select the knob control on the Numeric Controls palette and place it
on the front panel to the left of the waveform graph.
You will use this knob in a later exercise to control the amplitude of a
signal.
5. Select File»Save As and save this VI as Acquiring a Signal.vi
to an easily accessible location [en C:\TEMP\].
3. Select Sawtooth [Diente de Sierra] from the Signal type pull-down menu.
Notice that the waveform on the graph in the Result Preview section
changes to a sawtooth wave. The Configure Simulate Signal dialog
box should appear similar to Figure 1-5.
4. Click the OK button to apply 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.
6. When a double-headed arrow appears, shown at left, click and drag the
border of the Express VI until the Amplitude input appears.
Notice how you expanded the Simulate Signal Express VI to display a
new input. Because the Amplitude input appears on the block
diagram, you can configure the amplitude of the sawtooth wave on the
block diagram.
In Figure 1-5, notice how Amplitude is an option in the Configure
Simulate Signal dialog box. When inputs, such as Amplitude, appear
on the block diagram and in the configuration dialog box, you can
configure the inputs in either location.
Note The cursor does not switch to another tool while an object is selected.
5. When the Wiring tool appears, click the arrow and then click the
Amplitude input of the Simulate Signal Express VI, shown at left, to
wire the two objects together.
Notice that a wire appears and connects the two objects. Data flows
along this wire from the terminal to the Express VI.
6. Select File»Save to save this VI.
Running the VI
Running a VI executes your solution. Complete the following steps to run
the Acquiring a Signal VI.
1. Display the front panel by selecting Window»Show Front Panel or
by clicking the front panel.
Tip Press the <Ctrl-E> keys to switch from the front panel to the block diagram or from
the block diagram to the front panel.
Note Although the Abort Execution button looks like a stop button, the Abort
Execution button does not always properly close the VI. National Instruments
recommends stopping your VIs using the STOP button on the front panel. Use the Abort
Execution button only when errors prevent you from terminating the application using the
STOP button.