Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

MECHANICAL DEVICES OF MECHATRONIC SYSTEMS£4.38

vhdl£6.25

DSA£2.50

Total£13.13

Title: LabVIEWTM Basics I Course Manual
Description: This course manual teaches you how to use LabVIEW to develop test and measurement, data acquisition, instrument control, datalogging, measurement analysis, and report generation applications

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


LabVIEW Basics I
Course Manual
TM

Course Software Version 6
...

Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including
photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written
consent of National Instruments Corporation
...
com™, and PXI™ are trademarks of National Instruments Corporation
...


Worldwide Technical Support and Product Information
ni
...
F
...

B
...

D
...

F
...
SG-1
What You Need to Get Started
...
SG-4
Course Goals and Non-Goals
...
SG-6
Course Conventions
...
LabVIEW
...
Virtual Instruments
...
LabVIEW Environment
...
LabVIEW Help Options
...
1-22

Lesson 2
Creating, Editing, and Debugging a VI
A
...
2-2
B
...
2-11
C
...
2-20
Summary, Tips, and Tricks
...
2-29

Lesson 3
Creating a SubVI
A
...
3-2
B
...
3-3
C
...
3-9
D
...
3-16
Summary, Tips, and Tricks
...
3-18
© National Instruments Corporation

iii

LabVIEW Basics I Course Manual

Contents

Lesson 4
Loops and Charts
A
...
4-2
B
...
4-4
C
...
4-17
D
...
4-26
Summary, Tips, and Tricks
...
4-30

Lesson 5
Arrays, Graphs, and Clusters
A
...
5-2
B
...
5-5
C
...
5-7
D
...
5-10
E
...
5-13
F
...
5-30
G
...
5-36
Summary, Tips, and Tricks
...
5-47

Lesson 6
Case and Sequence Structures
A
...
6-2
B
...
6-11
C
...
6-16
D
...
6-20
Summary, Tips, and Tricks
...
6-23

Lesson 7
Strings and File I/O
A
...
7-2
B
...
7-4
C
...
7-11
D
...
7-21
E
...
7-26
Summary, Tips, and Tricks
...
7-37

LabVIEW Basics I Course Manual

iv

ni
...
Overview and Configuration
...
Data Acquisition VI Organization
...
Performing a Single Analog Input
...
The DAQ Wizards
...
Waveform Analog Input
...
Writing Waveform Data to File
...
Scanning Multiple Analog Input Channels
...
Analog Output
...
Digital Input and Output
...
Buffered Data Acquisition (Optional)
...
8-56
Additional Exercise
...
Instrument Control Overview
...
GPIB Communication and Configuration
...
Instrument Driver Overview
...
Using Instrument Driver VIs
...
VISA Overview
...
Using VISA Functions and VIs
...
Serial Port Communication
...
Waveform Transfers (Optional)
...
9-49
Additional Exercises
...
Customizing VI Properties
...
Creating Pop-Up Panels
...
Key Navigation
...
Editing VIs with Difficult VI Setup Options (Optional)
...
Customizing Palettes (Optional)
...
10-27

Appendix
A
...

C
...


Additional Information
...
A-4
VI Quick Reference
...
A-13

© National Instruments Corporation

v

LabVIEW Basics I Course Manual

Student Guide
Thank you for purchasing the LabVIEW Basics I course kit
...
This course manual and the accompanying software are used in the
three-day, hands-on LabVIEW Basics I course
...
Visit the Customer
Education section of ni
...


A
...
This course
manual assumes that you are familiar with Windows, Macintosh, or UNIX
and that you have experience writing algorithms in the form of flowcharts
or block diagrams
...
Each lesson consists of the following:


An introduction that describes the purpose of the lesson and what you
will learn



A description of the topics in the lesson



A set of exercises to reinforce those topics



A set of additional exercises to complete if time permits



A summary that outlines important concepts and skills taught in the
lesson

© National Instruments Corporation

SG-1

LabVIEW Basics I Course Manual

Student Guide

Several exercises in this manual use one of the following National
Instruments hardware products:


A plug-in multifunction data acquisition (DAQ) device connected to a
DAQ Signal Accessory containing a temperature sensor, function
generator, and LEDs



A GPIB interface connected to an NI Instrument Simulator

If you do not have this hardware, you still can complete most of the
exercises
...
Exercises that explicitly require hardware are indicated
with an icon, shown at left
...
For example, you can use a GPIB instrument in place
of the NI Instrument Simulator, or another National Instruments DAQ
device connected to a signal source, such as a function generator
...
After each block
diagram picture is a description of each object in the block diagram
...
com

Student Guide

B
...
6
...
5 or later and XWindows system software, an HP 9000
workstation model 700 series HP-UX running 10
...
0
...
0 or later
❑ A serial cable
❑ A GPIB cable
❑ (Optional) A word processing application such as (Windows) Notepad,
WordPad, (Macintosh) TeachText, (UNIX) Text Editor, vi, or vuepad
❑ LabVIEW Basics I course disks, containing the following files
...
llb

VI library containing subVIs used during the course

nidevsim
...
exe

© National Instruments Corporation

Self-extracting archive containing the solutions to all
the course exercises

SG-3

LabVIEW Basics I Course Manual

Student Guide

Class exercises that use the Thermometer VI use the (Demo) Thermometer VI in
the solutions
...
llb
...
Installing the Course Software
Complete the following steps to install the LabVIEW Basics I course
software
...
Copy the basics1
...
lib directory
...

2
...
zip to the labview\instr
...
After you start LabVIEW, the NI DevSim instrument driver is
located on the Functions»Instrument I/O»Instrument Drivers
palette
...
Copy the LV Basics I directory to the c:\exercises directory
...
(Optional) Double-click bas1soln
...


Macintosh
1
...
llb file from course disk 1 to the user
...
After you start LabVIEW, the contents of this
directory are located on the Functions»User Libraries palette
...
On a Windows computer, unzip the contents of the nidevsim
...

Copy the resulting directory to the labview:instrlib directory
...

3
...

4
...
exe and copy them to your hard drive to an appropriate
folder to install the solutions to all exercises
...
Log in as a superuser
...
Make sure the course disks are not write protected
...
Mount course disk 1 and copy the basics1
...
lib directory
...


LabVIEW Basics I Course Manual

SG-4

ni
...
On a Windows computer, unzip the contents of the nidevsim
...

Copy the resulting directory to the /labview/instrlib directory
...

5
...

6
...
exe and copy them to your hard drive to an appropriate
directory to install the solutions to all exercises
...
After you copy the files, use the chown command to change the owner
of each file from root to the current user
...
Course Goals and Non-Goals
This course prepares you to do the following:


Use LabVIEW to create applications
...




Understand front panels, block diagrams, and icons and connector
panes
...




Create and save VIs so you can use them as subVIs
...




Create applications that use plug-in DAQ devices
...
Course Map

Introduction to
LabVIEW

Creating, Editing,
and Debugging a VI

Creating a SubVI

Loops and Charts

Arrays, Graphs,
and Clusters

Case and Sequence
Structures

Strings and
File I/O

Data Acquisition
and Waveforms

Instrument
Control

VI Customization

LabVIEW Basics I Course Manual

SG-6

ni
...
Course Conventions
The following conventions appear in this course manual:
»

The » symbol leads you through nested menu items and dialog box options
to a final action
...

This icon denotes a tip, which alerts you to advisory information
...

This icon indicates that an exercise requires a plug-in GPIB interface or
DAQ device
...
Bold text also denotes parameter names,
controls and buttons on the front panel, dialog boxes, sections of dialog
boxes, menu names, and palette names
...
This font also denotes text that is a placeholder for a word
or value that you must supply
...

This font is also used for the proper names of disk drives, paths, directories,
programs, subprograms, subroutines, device names, functions, operations,
variables, filenames and extensions, and code excerpts
...


right-click

(Macintosh) Press -click to perform the same action as a

right-click
...


You Will Learn:
A
...
What a virtual instrument (VI) is
C
...
About the LabVIEW help options

© National Instruments Corporation

1-1

LabVIEW Basics I Course Manual

Lesson 1 Introduction to LabVIEW

A
...
In contrast to text-based programming
languages, where instructions determine program execution, LabVIEW
uses dataflow programming, where the flow of data determines execution
...

The user interface is known as the front panel
...

The block diagram contains this code
...

LabVIEW is integrated fully for communication with hardware such as
GPIB, VXI, PXI, RS-232, RS-485, and plug-in DAQ devices
...

Using LabVIEW, you can create test and measurement, data acquisition,
instrument control, datalogging, measurement analysis, and report
generation applications
...


LabVIEW Basics I Course Manual

1-2

ni
...
Virtual Instruments
LabVIEW programs are called virtual instruments (VIs)
...

The front panel is the user interface of the VI
...


You build the front panel with controls and indicators, which are the
interactive input and output terminals of the VI, respectively
...
Indicators are graphs,
LEDs, and other displays
...
Indicators simulate instrument
output devices and display data the block diagram acquires or generates
...
The block
diagram contains this graphical source code
...
You cannot delete a terminal
from the block diagram
...
Block diagram objects include
terminals, subVIs, functions, constants, structures, and wires, which transfer
data among other block diagram objects
...


After you build a front panel and block diagram, build the icon and the
connector pane so you can use it in another VI
...
A subVI corresponds to a subroutine in text-based
programming languages
...
An icon
is a graphical representation of a VI
...
If you use a VI as a subVI, the icon identifies the subVI
on the block diagram of the VI
...
The connector pane is a set of terminals that corresponds to the
controls and indicators of that VI, similar to the parameter list of a function
call in text-based programming languages
...
A
connector pane receives data at its input terminals and passes the data to the
block diagram code through the front panel controls and receives the results
at its output terminals from the front panel indicators
...
After
you create a VI, you can use it as a subVI on the block diagram of a
high-level VI
...

Using subVIs helps you manage changes and debug the block diagram
quickly
...
com

Lesson 1

Introduction to LabVIEW

As you create VIs, you might find that you perform a certain operation
frequently
...
Refer to Lesson 4, Loops and Charts, for more information
about using loops
...


You can create a subVI that performs that operation and call the subVI
twice
...
The following example
uses the Temperature VI as a subVI on its block diagram
...
LabVIEW Environment
When you launch LabVIEW, the following dialog box appears
...
Click the arrow next to the
button to create another type of LabVIEW object, such as a control
...
Click the arrow next
to the button to open recently opened files
...




Click the Search Examples button to open a help file that lists and links
to all available LabVIEW example VIs
...
Use this tutorial to learn basic LabVIEW concepts
...
(Macintosh) Click the Quit
button
...
Click the
Next button to view more tips
...


Front Panel and Block Diagram Windows
When you click the New VI button, an untitled front panel window appears
...
The other window contains the block
diagram
...


LabVIEW Basics I Course Manual

1-6

ni
...
The following toolbar appears
on the front panel
...
While the VI runs, the button changes
to the following if the VI is a high-level VI
...
This button indicates that the VI is broken and cannot run
...

Click the Run Continuously button to run the VI until you abort or pause
it
...

While the VI runs, the Abort Execution button appears
...

Avoid using the Abort Execution button to stop a VI, and either let the VI run to
completion or design a method to stop the VI programmatically
...
For example, you can programmatically stop a VI using a switch on the
front panel
...
When you click the Pause
button, LabVIEW highlights on the block diagram the location where you
paused execution
...

Select the Text Settings pull-down menu to change the font settings for
the VI, including size, style, and color
...

Select the Distribute Objects pull-down menu to space objects evenly,
including gaps, compression, and so on
...

Select one of the objects with the Positioning tool and then select from
Move Forward, Move Backward, Move To Front, and Move To Back
...
com

Lesson 1

Introduction to LabVIEW

Block Diagram Toolbar
When you run a VI, buttons appear on the block diagram toolbar that you
can use to debug the VI
...


Click the Highlight Execution button to see the flow of data through the
block diagram
...

Click the Step Into button to single-step into a loop, subVI, and so on
...
Each node
blinks to denote when it is ready to execute
...

Click the Step Over button to step over a loop, subVI, and so on
...

Click the Step Out button to step out of a loop, subVI, and so on
...

The Warning button appears when there is a potential problem with the
block diagram, but it does not stop the VI from running
...


Shortcut Menus
The most often-used menu is the object shortcut menu
...
Use the shortcut menu items to change the look
or behavior of front panel and block diagram objects
...

(Macintosh) Press the key and click the object, front panel,

or block diagram
...
Some menu items also list shortcut key combinations
...


© National Instruments Corporation

1-9

LabVIEW Basics I Course Manual

Lesson 1 Introduction to LabVIEW

Note

Some menu items are unavailable while a VI is running
...




Use the Edit menu to search for and modify components of a VI
...




Use the Tools menu to communicate with instruments and DAQ
devices, compare VIs, build applications, enable the Web Server, and
configure LabVIEW
...




Use the Window menu to display LabVIEW windows and palettes
...


Palettes
LabVIEW has graphical, floating palettes to help you create and run VIs
...
You
can place these palettes anywhere on the screen
...
The Tools palette is available on the front panel and
the block diagram
...

When you select a tool, the cursor icon changes to the tool icon
...

Select Window»Show Tools Palette to display the Tools palette
...
Press the key and
right-click to display a temporary version of the Tools palette at the location
of the cursor
...
com

Lesson 1

Introduction to LabVIEW

Use the Operating tool to change the values of a control or select the text
within a control
...

Use the Positioning tool to select, move, or resize objects
...

Use the Labeling tool to edit text and create free labels
...

Use the Wiring tool to wire objects together on the block diagram
...

Use the Scrolling tool to scroll through windows without using scrollbars
...

Use the Probe tool to create probes on wires on the block diagram
...

Use the Color Copy tool to copy colors for pasting with the Coloring tool
...
It also displays the current
foreground and background color settings
...
When you click a subpalette icon, the entire palette changes
to the subpalette you selected
...

Use the navigation buttons on the Controls and Functions palettes to
navigate and search for controls, VIs, and functions
...


© National Instruments Corporation

1-11

LabVIEW Basics I Course Manual

Lesson 1 Introduction to LabVIEW

Controls Palette
Use the Controls palette to place controls and indicators on the front
panel
...
Select
Window»Show Controls Palette or right-click the front panel workspace
to display the Controls palette
...
Tack down the Controls
palette by clicking the pushpin on the top left corner of the palette
...
The Functions palette
is available only on the block diagram
...
You also can display the Functions palette by right-clicking an open
area on the block diagram
...


LabVIEW Basics I Course Manual

1-12

ni
...


Loading VIs
You load a VI into memory by selecting File»Open
...

The VIs you edit in this course are in c:\exercises\LV Basics I
...


The Loading field lists the subVIs of the VI as they are loaded into memory
...
You
can cancel the load at any time by clicking the Stop button
...

The Searching field lists directories or VIs as LabVIEW searches through
them
...


Saving VIs
Select Save, Save As, Save All, or Save with Options from the File menu
to save VIs as individual files or group several VIs together and save them
in a VI library
...
llb
...

LabVIEW uses native file dialogs for loading and saving
...


Moving VIs Across Platforms
You can transfer VIs from one platform to another, such as from Macintosh
to Windows
...

Because VIs are files, you can use any file transfer method or utility to
move VIs between platforms
...
Such network transfers
eliminate the need for additional file translation software
...



(Macintosh) DOS Mounter, MacLink, and Apple File Exchange convert

PC files to the Macintosh format and vice versa
...



(HP-UX) The doscp command mounts PC disks and copies their files
...


LabVIEW Basics I Course Manual

1-14

ni
...

1
...
The LabVIEW dialog box appears
...
Click the Search Examples button
...

3
...
The Frequency Response VI front panel appears
...
llb\Frequency Response
...


Front Panel
4
...

This VI simulates sending a stimulus signal to a Unit Under Test (UUT)
and then reading back the response
...


5
...
Click the mark on the knob and drag it to the desired location, use
the increment or decrement arrows on the digital control, or place the
cursor in the digital display and enter a number
...
The number is not passed to the VI until you
click this button or press the key
...


© National Instruments Corporation

1-15

LabVIEW Basics I Course Manual

Lesson 1 Introduction to LabVIEW

6
...
Try adjusting the other
controls on the panel and running the VI to see what changes occur
...
Select Window»Show Diagram or press the keys to display
the following block diagram for the Frequency Response VI
...
(Sun) Press the
keys
...


This block diagram contains several of the basic block diagram
elements, including subVIs, functions, and structures, which you will
learn about later in this course
...
Use the Operating tool to double-click the following DMM icon
...
After you
double-click it, the following front panel of that subVI opens
...
This is
why LabVIEW programs are called virtual instruments
...
com

Lesson 1

Introduction to LabVIEW

application or reuse those parts in the same or other applications
...

9
...

10
...


End of Exercise 1-1

© National Instruments Corporation

1-17

LabVIEW Basics I Course Manual

Lesson 1 Introduction to LabVIEW

D
...


Context Help Window
To display the Context Help window, select Help»Show Context Help or
press the keys
...
(Sun) Press the keys
...


When you move the cursor over front panel and block diagram objects, the
Context Help window displays the icon for subVIs, functions, constants,
controls and indicators, with wires attached to each terminal
...
In the window, required connections
are bold, recommended connections are plain text, and optional connections
are dimmed or do not appear
...


Click the Simple/Detailed Context Help button located on the lower left
corner of the Context Help window to change between simple and detailed
context help
...

Optional terminals are shown by wire stubs, informing you that other
connections exist
...


LabVIEW Basics I Course Manual

1-18

ni
...
When the contents are locked, moving the cursor
over another object does not change the contents of the window
...
You also can access this option from the
Help menu
...


LabVIEW Help
The LabVIEW Help contains detailed descriptions of most palettes, menus,
tools, VIs, and functions
...

You can access this information either by clicking the More Help button in
the Context Help window, selecting Help»Contents and Index, or
clicking the sentence Click here for more help in the Context Help
window
...


Part A
1
...

2
...

a
...

b
...
The Technical Support Resources topic appears
...
Click the Technical Support link to open the Technical Support
section of ni
...

d
...

3
...

a
...
The Related Documentation topic appears
...
Click the LabVIEW User Manual link to open the PDF version of
the manual in the LabVIEW Help window
...
Click the Help Topics button on the toolbar to hide the Contents tab
of the LabVIEW Help window
...
Click the Help Topics button again to display the Contents tab
...
Click the Back button to return to the Related Documentation topic
...
Browse through a few of the other sections of the LabVIEW Help
...
The Frequency Response VI should still be open from Exercise 1-1
...

6
...

7
...

(Macintosh) Press the keys
...
(HP-UX and Linux) Press the keys
...
com

Lesson 1

Introduction to LabVIEW

8
...

a
...
A description of the
function appears in the Context Help window
...

Try displaying the help for other functions
...
Move the Wiring tool, shown at left, over the terminals of the
Logarithm Base 10 function
...

c
...
The Context Help window
displays the data type of the wire
...
In the front panel window, select File»Close to close the Frequency
Response VI
...


End of Exercise 1-2

© National Instruments Corporation

1-21

LabVIEW Basics I Course Manual

Lesson 1 Introduction to LabVIEW

Summary, Tips, and Tricks


Virtual instruments (VIs) contain three main components—the front
panel, the block diagram, and the icon and connector pane
...




The block diagram contains the graphical source code composed of
nodes, terminals, and wires
...
Press the
key and right-click to display a temporary version of the Tools palette at
the location of the cursor
...
Right-click an open area on the front panel to display the
Controls palette
...
Right-click an
open area on the block diagram to display the Functions palette
...

(Macintosh) Access shortcut menus by pressing the key

while you click an object, the front panel, or the block diagram
...


1-22

ni
...
com

Lesson 2
Creating, Editing, and
Debugging a VI
This lesson introduces the basics of creating a VI
...
How to create VIs
B
...
Debugging techniques

© National Instruments Corporation

2-1

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

A
...
Refer to Lesson 3, Creating a SubVI, for
more information about the icon and connector pane
...
Controls are
knobs, push buttons, dials, and other input devices
...
Controls simulate instrument input devices and
supply data to the block diagram of the VI
...

Use the Controls palette to place controls and indicators on the front
panel
...
Select
Window»Show Controls Palette or right-click the front panel workspace
to display the Controls palette
...


2

1

3

1

Increment arrow buttons

2

Digital control

3

Digital indicator

To enter or change values in a digital control, you can click the increment
arrow buttons with the Operating tool or double-click the number with either
the Labeling tool or the Operating tool, type a new number, and press the
key
...


Boolean Controls and Indicators
Use Boolean controls and indicators to enter and display Boolean (TRUE or
FALSE) values
...
The most common Boolean objects are the vertical toggle switch and
the round LED, as shown in the following illustration
...
com

Lesson 2

Creating, Editing, and Debugging a VI

Configuring Controls and Indicators
You can configure nearly all controls and indicators using their shortcut
menus
...
For example, to configure a label, right-click the label
...


Block Diagram
The block diagram is composed of nodes, terminals, and wires, as shown in
the following illustration
...
They are analogous to statements,
operators, functions, and subroutines in text-based programming languages
...
Functions are built-in
execution elements, comparable to an operator, function, or statement
...
Structures are process control elements, such as Sequence
structures, Case structures, For Loops, or While Loops
...


© National Instruments Corporation

2-3

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

Terminals
Front panel objects appear as terminals on the block diagram
...
For example, a DBL
terminal, shown at left, represents a double-precision, floating-point
numeric control or indicator
...
Terminals are analogous to parameters and
constants in text-based programming languages
...
Control and indicator
terminals belong to front panel controls and indicators
...
The data then enter the Add and Subtract functions
...
The data flow to the indicator terminals, where
they exit the block diagram, reenter the front panel, and appear in front panel
indicators
...
The connector panes of the Add and Subtract
functions, shown at left, have three node terminals
...


Wires
You transfer data among block diagram objects through wires
...
Each wire has
a single data source, but you can wire it to many VIs and functions that read
the data
...
The following examples are the most common wire types
...
You also can automatically wire objects already on the block
diagram
...


LabVIEW Basics I Course Manual

2-4

ni
...
When you
release the mouse button to place the object on the block diagram,
LabVIEW automatically connects the wires
...
You can adjust the automatic wiring settings by
selecting Tools»Options and selecting Block Diagram from the top
pull-down menu
...

To return to the icon, right-click the function node and select Visible
Items»Terminals from the shortcut menu to remove the checkmark
...
A block diagram node
executes when all its inputs are available
...

Visual Basic, C++, JAVA, and most other text-based programming
languages follow a control flow model of program execution
...

For example, consider a block diagram that adds two numbers and then
subtracts 50
...
In this case, the block
diagram executes from left to right, not because the objects are placed in that
order, but because one of the inputs of the Subtract function is not valid until
the Add function has finished executing and passed the data to the Subtract
function
...


© National Instruments Corporation

2-5

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

In the following example, consider which code segment would execute
first—the Add, Random Number, or Divide function
...
In a situation where
one code segment must execute before another, and no data dependency
exists between the functions, use a Sequence structure to force the order
of execution
...


Searching for Controls, VIs, and Functions
Use the following navigation buttons on the Controls and Functions
palettes to navigate and search for controls, VIs, and functions:


Up—Takes you up one level in the palette hierarchy
...
In search mode, you can
perform text-based searches to locate controls, VIs, or functions in the
palettes
...


For example, if you want to find the Random Number function, click the
Search button on the Functions palette toolbar and start typing Random
Number in the textbox at the top of the palette
...
You can click one
of the search results and drag it to the block diagram, as shown in the
following example
...
com

Lesson 2

Creating, Editing, and Debugging a VI

Double-click the search result to highlight its location on the palette
...


© National Instruments Corporation

2-7

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

Exercise 2-1
Objective:

Convert C to F VI

To build a VI
...

1

In wiring illustrations, the arrow at the end of this mouse icon shows where
to click and the number on the arrow indicates how many times to click
...
Select File»New to open a new front panel
...


2
...

3
...
You will use this control to enter the
value for degrees Centigrade
...
Select the digital control on the Controls»Numeric palette
...

b
...

c
...
If you do not type the
name immediately, LabVIEW uses a default label
...

4
...
You will use this indicator to display
the value for degrees Fahrenheit
...
Select the digital indicator on the Controls»Numeric palette
...
Move the indicator to the front panel and click to place the indicator
...
Type deg F inside the label and click outside the label or click the
Enter button
...
The terminals represent the data type of the control or
indicator
...

Note

Control terminals have a thicker border than indicator terminals
...
com

Lesson 2

Creating, Editing, and Debugging a VI

Block Diagram

5
...

6
...
If the Functions palette is
not visible, right-click an open area on the block diagram to display it
...
Select the numeric constant on the Functions»Numeric palette and
place two of them on the block diagram
...

8
...
8 in one constant and 32
...

If you moved the constants before you typed a value, use the Labeling
tool to enter the values
...
Use the Wiring tool, shown at left, to wire the icons as shown in the
previous block diagram
...
You can start
wiring at either terminal
...
Press the spacebar to toggle
the wire direction
...
Return to the icons after
wiring by right-clicking the functions and selecting Visible
Items»Terminals from the shortcut menu to remove the checkmark
...




To cancel a wire you started, press the key, right-click, or
click the source terminal
...
Display the front panel by clicking it or by selecting Window»Show
Panel
...
Save the VI, because you will use this VI later in the course
...
Select File»Save
...
Navigate to c:\exercises\LV Basics I
...

c
...
vi in the dialog box
...
Click the Save button
...
Enter a number in the digital control and run the VI
...
Use the Operating tool, shown at left, or the Labeling tool to
double-click the digital control and type a new number
...
Click the Run button, shown at left, to run the VI
...
Try several different numbers and run the VI again
...
Select File»Close to close the Convert C to F VI
...
com

Lesson 2

Creating, Editing, and Debugging a VI

B
...

You cannot delete a control or indicator terminal from the block diagram
...


Selecting Objects
Use the Positioning tool to click an object to select it on the front panel and
block diagram
...
To select
more than one object, press the key while you click each additional
object you want to select
...


Moving Objects
You can move an object by clicking it with the Positioning tool and dragging
it to a desired location
...
Press the key while you press the arrow keys to move
objects several pixels at a time
...
The
direction you initially move determines whether the object is limited to
horizontal or vertical movement
...


Undo/Redo
If you make a mistake while editing a VI, you can undo or redo those steps
by selecting Undo or Redo from the Edit menu
...


© National Instruments Corporation

2-11

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

Duplicating Objects
You can duplicate most objects by pressing the key while using the
Positioning tool to click and drag a selection
...
(Sun) Press the key
...

(HP-UX) You also can duplicate objects by clicking and dragging the object

with the middle mouse button
...
This process is called cloning
...


Labeling Objects
Use labels to identify objects on the front panel and block diagram
...

Owned labels belong to and move with a particular object and annotate that
object only
...
Free
labels are not attached to any object, and you can create, move, rotate, or
delete them independently
...

To create a free label, use the Labeling tool to click any open area and type
the text you want to appear in the label in the box that appears
...
By default, pressing the key adds a new line
...
To end text entry with the key,
select Tools»Options, select Front Panel from the top pull-down menu,
and place a checkmark in the End text entry with Return key checkbox
...


Selecting and Deleting Wires
A wire segment is a single horizontal or vertical piece of wire
...
The point at which three or four wire
segments join is a junction
...
To select a wire segment, use the
Positioning tool to click the wire
...


LabVIEW Basics I Course Manual

2-12

ni
...

1

2

3

Broken Wires
A broken wire appears as a dashed black line, as shown in the following
example
...

1

2
1

© National Instruments Corporation

Dashed wire (broken)

2

2-13

Solid wire (good)

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

Move the Wiring tool over a broken wire to view the tip strip that describes
why the wire is broken
...
You can remove all broken
wires by selecting Edit»Remove Broken Wires
...
Sometimes a wire appears broken
because you are not finished wiring the block diagram
...

Certain controls and indicators use text in more than one display
...

You can modify each text display independently by using the Labeling tool
to highlight the text, as shown in the following graph
...


Resizing Objects
You can change the size of most front panel objects
...
When you resize an object, the font size remains the same
...
Press the key while you
drag the resizing handles or circles to keep the object proportional to its
original size
...


LabVIEW Basics I Course Manual

2-14

ni
...
To space
objects evenly, select the objects and select the Distribute Objects
pull-down menu on the toolbar
...
You also can copy pictures or text from
other applications and paste them on the front panel or block diagram
...


Coloring Objects
You can change the color of many objects but not all of them
...

Use the Coloring tool and right-click an object or workspace to add or
change the color of front panel objects or the front panel and block diagram
workspaces
...

You also can make front panel objects transparent to layer them
...


© National Instruments Corporation

2-15

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

Exercise 2-2
Objective:

Editing Exercise VI

To edit a VI
...


Note

Remember that you can select Edit»Undo if you make a mistake
...
Select File»Open and navigate to c:\exercises\LV Basics I to
open the Editing Exercise VI
...


2
...

a
...
The control label follows the position
of the control
...
Click a blank space on the front panel to deselect the control
...
Click the label and drag it to another location
...
You can position an owned label anywhere relative to the
control
...


LabVIEW Basics I Course Manual

2-16

ni
...
Reposition the three slide switches as a group
...
Use the Positioning tool to click an open area near the three switches
and drag a selection rectangle around the switches
...
Click and drag one of the selected switches to a different location
...

4
...

a
...

b
...

c
...

5
...

a
...
Resizing circles appear on
the LED
...
Click and drag the cursor to enlarge the LED
...

6
...

a
...

Use the Operating tool, shown at left, to click the LED and change
its state to ON and bright green (TRUE)
...
Use the Coloring tool, shown at left, to right-click the LED and
display the color picker
...
Select a red color to change the ON state to red
...
Display and edit the owned label of the digital indicator
...
Use the Labeling tool, shown at left, to right-click the digital
indicator and select Visible Items»Label from the shortcut menu
...

b
...

c
...

8
...

a
...

b
...


© National Instruments Corporation

2-17

LabVIEW Basics I Course Manual

Lesson 2 Creating, Editing, and Debugging a VI

9
...

a
...

(Macintosh) Press the