<< Chapter < Page | Chapter >> Page > |
Complete the following steps to create a VI that takes a number representing degrees Celsius and converts it to a numberrepresenting degrees Fahrenheit.
Window>>Tile Left and Right
to
display the front panel and block diagram side by side or
Window>>Tile Up and Down
to display the front panel and
block diagram stacked.Controls>>Numeric Controls
to display the
Numeric Controls
palette.
If the
Controls
palette is not visible,
right-click an open space on the front panel workspace todisplay it.Numeric Control
. Move the
control to the front panel and click to place thecontrol.deg C
in the label of the control and press
the
<Enter>
key or click the
Enter
button, shown in
,
on the toolbar. If you do not type the name immediately,LabVIEW uses a default label.Labeling
tool, or
right-clicking and selecting
Properties
from
the shortcut menu to display the property dialog box.Numeric Indicator
located on
the
Controls>>Numeric Indicators
palette.deg F
in the label and press the
<Enter>
key or click the
Enter
button.Window>> Show Block Diagram
.
LabVIEW creates corresponding control and indicatorterminal icons on the block diagram when you place
controls and indicators on the front panel. Theterminals represent the data type of the control or
indicator. You should see two double-precision,floating-point terminals on the block diagram, one
indicator, and one control.
Multiply
function, located on the
Functions>>Arithmetic&Comparison>>Express
Numeric
palette, on the block diagram to the right of
the
deg C
indicator. If the
Functions
palette is not visible, right-click
an open space on the block diagram workspace to display it.Add
function, located on the
Functions>>Arithmetic&Comparison>>Express Numeric
palette, on the block diagram to the right of the
Multiply
function.Numeric Constant
, located on the
Functions>>Arithmetic&Comparison>>Express Numeric
palette, to the lower left of the
Multiply
function. Type
1.80
in
the constant. When you first place a numeric constant, it ishighlighted so you can type a value. If the constant is no
longer highlighted, double-click the constant to activatethe
Labeling
tool.Numeric Constant
, located on the
Functions>>Arithmetic&Comparison>>Express
Numeric
palette, to the left of the
Add
function. Type
32.0
in the constant.Wiring
tool, shown in
, to wire the icons as shown in
.
Wiring
tool to click the first terminal,
move the tool to the second terminal, and click thesecond terminal. You can start wiring at either
terminal.spacebar
to toggle the
wire direction.Multiply
and
Add
functions
and select
Visible Items>>Terminals
from
the shortcut menu to display the connector pane on theblock diagram. Return to the icons after wiring by
right-clicking the functions and selecting
Visible Items>>Terminals
from the shortcut menu
to remove the checkmark.Wiring
tool over a
terminal, the terminal area blinks, indicating thatclicking will connect the wire to that terminal and atip strip appears, displaying the name of the
terminal. If the
Context Help
window is
open, the terminal area also blinks in the
Context Help
window.<Esc>
key, right-click, or click the
terminal where you started the wire.Window>>Show Front Panel
.Convert C to F.vi
in the
C:\Exercises\LabVIEW Basics I
directory.Operating
tool, shown in
, or the
Labeling
tool to
double-click the numeric control and type a new number.Run
button, shown at left, to run the VI.Edit Icon
from the shortcut menu.
The
Icon Editor
dialog box appears.Select
tool, shown in
, on the left side of the
Icon Editor
dialog box to select the default icon.<Delete>
key to remove the default
icon.Rectangle
tool, shown in
, to redraw the border.Text
tool, shown in
, and change the font to
Small
Fonts
.Text
tool to click the editing area
where you will begin typing.C
and
F
. While the
text is active, you can move the text by pressing thearrow keys.Pencil
tool,
shown in
, to create the arrow.
<Shift>
key while you use the
Pencil
tool to drag the cursor.Select
tool and the arrow keys to
move the text and arrow you created.B&W
icon and click the
256 Colors
button in the
Copy from
section to create a black and white icon, which
LabVIEW uses for printing unless you have a colorprinter.16 Colors
icon and click the
256 Colors
button in the
Copy from
section.OK
button to close the
Icon Editor
dialog
box. The icon appears in the upper right corner of thefront panel and block diagram.Show Connector
from the shortcut menu to define the
connector pane terminal pattern. LabVIEW selects a defaultconnector pane pattern based on the number of controls and
indicators on the front panel. For example, this front panelhas two terminals,
deg C
and
deg F
, so LabVIEW selects a connector pane pattern with
two terminals, shown in
.Help>>Show Context Help
to display
the
Context Help
window.Wiring
tool, and the terminal turns
black.deg C
control. A marquee
highlights the control on the front panel.deg F
indicator.Context Help
window shows that both terminals
are connected to double-precision, floating-pointvalues.Notification Switch
Would you like to follow the 'Labview graphical programming' conversation and receive update notifications?