Workshop
2: Introduction to LabVIEW
1. Learn the basics using Sample.VI
A sample LabVIEW program was created to demonstrate some
of the basics of LabVIEW. You will work individually during this session
so that you each can get a feel for how the software works.
The front panel and diagram for the program is shown at
the right. The program performs three tasks using two inputs: x+y, x*y,
and x^y. Through a guided hands-on exploration of the program, the following
questions will be answered (in order):
- Run the program from the front panel. What does the program
do?
- Open the diagram. What do you see? What do the different
icons stand for?
- Open the help window (Ctrl-H), and point to one of the
operators. What do you see?
- Activate the Lightbulb Mode, then run the program. What
do you notice about the order of execution? (Note the importance of Sequence
Structure)
- Let's add a "difference" function to the program.
This will be the first exercise for adding an operator, indicator, and
wiring them together.
2. Study loop structures using For.VI and While.VI
Two programs were made for demonstrating the difference
between For and While Loops. The programs are simply loops, with a delay
of 200ms in each. The For Loop will stop after user-specified number of
repetitions, and the While Loop will stop when the user clicks on the STOP
switch.
3. Make a new program
Learn how to make and debug programs through performing
simple tasks. The following exercises will be shown step-by-step:
- Open a new program.
- Make an array, and specify the type by dragging a numeric
control into the box.
- Make a numeric indicator on the front panel.
- Open the diagram, and draw a For Loop.
- On the diagram, place the array outside the loop, and
the number inside. Wire the two together. What happens to the wiring? (discuss
auto indexing)
- What do you think the program does? Run it using the
Lightbulb Mode - were you right?
- Connect the numeric indicator with "i". What
happens? (discuss broken wire and broken arrow)
- Click on the broken arrow - an error list should pop
up. What is wrong with the program?
- Debug the program by removing bad wires and re-wiring.
Run it again - does it work now?
- Other tips - using the right mouse button
You are now ready to create
your own simple program.