where EXT means EXTended precision real number.
LabVIEW has two parts: the panel and the diagram.
The panel is where the user controlled or observed actions
take place. This is like the computer screen when running a Fortran
program or the control panel at a power station. The diagram
is the guts of the program, where the numerical manipulation goes
on. This is like the actual Fortran code or the piping and valves
of a power station. If you close the panel, you close the
program (in other words, the panel must be open for the
diagram to be open). To switch between the two, use Control-f.
This means press Control and f at the same time.
To run the program either use Control-r or click in the
arrow symbol on the upper bar. If there is a broken
arrow, there is an error in your program. Click on the broken
arrow to find out what is wrong with your program. To manually
stop a run, hit the stop sign shaped symbol on the upper
bar. This is like a control-c for a Fortran run. Different types
of data are color coded; light blue is an 8 bit integer, for example.
Some important terms:
VI (Virtual Instrument): These are like subroutines in
Fortran. Many of the most useful are already in the LabVIEW library,
and you can make your own. They only appear on the diagram.
Click: Quickly press and release the mouse button.
Press: Press the specified mouse button down and hold
it down.
Finger: This is the cursor with the index finger extended.
It is used for changing values of control, switching switches,
etc. It appears mostly on the panel.
Hand: This is the cursor that looks like an open hand.
It is used for moving things around the screen.
Letter: This is the typing cursor. It allows you to type
like a normal typewriter.
Wire: The spool cursor. It is not used on the panel,
but is used extensively on the diagram to 'wire' (connect)
VI's. To release a wire that you did not want, double click. To
remove bad wires, Control-w
Tab: The tab (key on the keyboard) allows you
to toggle between the finger, hand, letter and wire cursors.
Control: These are user-interfaces with the program.
Indicator: These display the results of the program.
Boolean: A true-false operator.
Cluster: A 'bundle' of data. Instead of (X,Y,Z) with
three values, a bundle is more like (XYZ). A bundle may contain
mixed types of data, like strings and numbers.
Graph: Requires an X and a Y operator and plots Y vs.
X. When wiring to a graph on the Diagram, a cluster
input is required.
Chart: Graphs an Y for each reading of Y, as in temperature
(Y) versus time.
Brush: This is the brush icon, (small pictures), this
is used to paint the screen in pretty colors. Must be manually
selected from TOOLS.
Arrays: These must be selected for their type (numeric,
Boolean, string, cluster) with the Control key.
Select: when you select an object, click to highlight
it and then let go.
Move: To move an object, using the hand, press the mouse
button over the object and move the mouse, releasing when you
have reached the area you want it to be in.
Arrow, Broken Arrow: This refers to the arrow symbol
in the upper bar, second to the right. If it is complete, the
program is OK. If it is broken, the program will not run.
The 'power key' is the Control key. To get additional menus
for any object, press the right-most mouse button.
Control-C This is the copy Control. It copies whatever
is selected, into a part of the computer's memory, called the
clipboard. You then can paste these anywhere using Control-v,
below.
Control-V This 'pastes' (or deposits) whatever is in
the buffer wherever you have last clicked.
Control-T (tile) This puts the diagram and the panel
side by side on the screen. Whenever you open a LabVIEW file,
you will have to use this Control to bring up the diagram next
to the panel.
Control-E Toggles from panel to diagram (to panel). If
you make the panel or the diagram as large as the screen, you
will have to use this key to switch between the panel and the
diagram.
Control-B Removes bad wires.
Control-S Saves the program.
Control-H (help window) Displays wiring connections and
names for icons touched with the wire cursor. The help
window is color coded to match the type of input/output expected.
Control-Q Quits the program.
On the following pages are four problems that will help you
become familiar with LabVIEW.
Problem 1: Getting started
(refer to Figure 1)
Suppose we wish to graph:
y = A sin (BQ)
where A and B are variable parameters.
1. Turn on a PC.
2. Open LabVIEW 4.0, it should be a desktop icon: LabVIEW may
take a minute to load. You are looking at Untitled 1 Panel.
Press Control-T. This will display the Panel and the Diagram
side by side.
3. Icons for internal programming elements are found on the
functions or controls toolbars. Only one of these
will show up at a time. These may be called up using the right-most
mouse button while on the desktop. They may be tecked open using
the little push-pin in their upper-left corners. Functions selected
from the functions toolbar only go onto the diagram; controls
only on the panel. Each toolbar contains icons which themslves
reveal other icons. Press the mouse button and hold down until
finished with the entire selection. A selection is made by releasing
the mouse button.
4. Go to NUMERIC on the controls toolbar and select the first
icon, (small picture) the Digital Control box. Move your
cursor into the panel and click where you wish the icon
to be placed. Notice that every item you place on the panel
has a counterpart on the diagram. Label this box "A
VAR" (for variable A) Just start typing right after the icon
has been placed. This control will vary the amplitude. Put the
cursor on the panel (left) side. Find the hand cursor.
If you have the arrow cursor, press the tab button until
you get the hand cursor. Using the hand cursor, move this box
to the upper left by clicking and dragging the icon NOT THE
LABEL! Similarly, place a box titled "B VAR" in
the upper right.
5. Go to CONTROLS. Go to BOOLEAN and select the round button.
Name this "ON/OFF". Place in the upper middle.
6. Go to CONTROLS. Go to GRAPHS and select WAVEFORM CHART. Name
the chart "Wave". Move the chart to the middle. This
is where your sine wave graph will appear.
7. Place the cursor over the diagram and click. This
makes the diagram the active window and this is where you will
program. Go to FUNCTIONS. Go to STRUCTS & CNSTS (abbreviation
for STRUCTURES AND CONSTANTS). Select the while loop.
8. Move all previous icons to upper portion of the screen.
9. Using the arrow cursor, move slowly across the lower corner
of the while loop until the hand turns into a right angle. Press
and drag the corner out to a good size (about a half of the diagram
screen). DO NOT COVER ANY ICONS YOU JUST CREATED!
10. Using the arrow cursor, place all the icons on the screen
inside the while loop as follows.
10.1 Place the "ON/OFF" icon in the lower right next
to the loop arrow.
10.2 Place the "Wave" icon in the middle right.
10.3 Place the "A VAR" icon in the upper middle.
10.4 Place the "B VAR" icon in the upper left.
11. Go to FUNCTIONS. Go to NUMERIC. Go to TRIG and select the
Sine. Place this icon in the middle of the while loop.
12. Go to FUNCTIONS. Go to NUMERIC and select the multiply
icon. Place this in the middle left, between "B Var"
and the boxed "i".
13. Repeat the previous step, but place the multiply icon between
the Sine icon and the "Wave" icon. Press Control-S
to save the program (please call it "your name_1.vi").
14. Now that all the pieces are in place, it is time to wire
them together. Notice that the arrow symbol on the upper bar is
broken; your program does not work. Place the cursor over the
diagram. Press the tab button several times. Notice the arrow
cursor change to a letter cursor and then a wire cursor. You wire
with the wire cursor.
14.1 Move the spool cursor to the ON/OFF icon (it will be blinking).
Click once on the "ON/OFF" icon and then on the loop
arrow. This will wire the "ON/OFF" button to
the while loop's operator. A while loop executes as long as the
Boolean's value is true.
14.2 Press Control-h (help window) to see the icon terminals.
Move the wire cursor to one of the multiply icons. Notice how
the multiply icon is split into three parts and what each part
represents (X,Y,X*Y). Do the same to the Sine icon, and notice
it is in two parts (x and sin x).
14.3 Click on the "B VAR" icon and then on the "y"
part of the multiply icon below it, thus wiring the two together.
14.4 Click on the boxed "i" in the lower left and
then on the "x" part of the same (left) multiply icon.
The "i" counts iterations, and will serve as our theta
variable.
14.5 Click on the "x*y" part of the multiply icon
and then on the x part of the Sine icon.
14.6 Click on the "A VAR" icon and then on the "x"
part of the other multiply icon.
14.7 Click on the sin x part of the Sine icon and then on the
"y" part of the right hand multiply icon.
14.8 Click on the x*y part of the multiply icon and then on
"Wave".
14.9 Notice the Arrow symbol in the upper bar is no longer broken:
your program should work!
14.10 Press Control-S to save the program.
15. Click the cursor on the panel's side again (left
side). The following steps will allow you to run your program.
16. Press the tab button to change the wire cursor to a finger
cursor. You can remove the help box by clicking on the small box
in the upper left corner of help window.
17. Move the finger cursor to the "ON/OFF" button
and press it. The button is now on. (The default setting for any
Boolean is false; your program will not run until it is true.)
18. Move slowly across the "A VAR" indicator's icon
until the finger cursor turns into a letter cursor (vertical line
with a split on top and bottom). Click once and move letter cursor
to the one's place using arrow keys and enter a 1 in the "A
VAR" box then hit return.
19. Move slowly across the "B Var" box until the finger
cursor turns into a letter cursor. Place the cursor over the icon
and click the right mouse button, choose choose Data Range...
and make the increment 0.1. Click on this numeric contol's up
arrow and enter a 0.1 in the "B VAR" box.
20. If there are no mistakes you may now click on the "ON/OFF"
button and then click on the Arrow symbol on the upper bar to
run your program. If it does run, click on the graph with the
right mouse button, and select Autoscale Y.
21. Change the values of A and B (this can be done by using
the small arrows on the "A VAR" and "B VAR"
boxes or by clicking over them and typing) and observe how the
wave changes. What do large values of B do to the graph? What
do zeros do?
22. To stop, click on the "ON/OFF" button. To restart,
be sure the "ON/OFF" button is 'on' (depressed).
23. Use the tab key and select the brush. Click on an object
to paint your panel, chart or whatever else you desire.
24. LabVIEW is very fast. You should slow down your program
to let you see what is being graphed.
24.1 Go to diagram side and click. Go to FUNCTIONS. Go to TIME
& DIALOG.
24.2 Select the 'wrist watch' icon in the second column, called
Wait (ms). Place it in the lower middle of the while loop. (You
must first return to the hand cursor)
24.3 Place the cursor on the new icon and press the right-most
mouse button. Select "create constant". Type in a 10.
25 Run as before.
26 Press Control-S to save program.