0% found this document useful (0 votes)
288 views

Lesson 2 - Navigating LabVIEW

The document provides an overview of navigating and building virtual instruments (VIs) in LabVIEW. It discusses the main parts of a VI, including the front panel, block diagram, and icon/connector pane. It also reviews the tools and palettes for adding controls and indicators to the front panel and functions, nodes, and wires to the block diagram. The document gives examples of different data types and control structures that can be used when building a simple VI.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
288 views

Lesson 2 - Navigating LabVIEW

The document provides an overview of navigating and building virtual instruments (VIs) in LabVIEW. It discusses the main parts of a VI, including the front panel, block diagram, and icon/connector pane. It also reviews the tools and palettes for adding controls and indicators to the front panel and functions, nodes, and wires to the block diagram. The document gives examples of different data types and control structures that can be used when building a simple VI.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

Lesson 2

Navigating LabVIEW

TOPICS
A. Virtual Instruments G. Searching Palettes
B. Parts of a VI H. Selecting a Tool
C. Starting a VI I. Dataflow
D. Project Explorer J. Building a Simple VI
E. Front Panel
F. Block Diagram

ni.com/training
A. Virtual Instruments (VIs)
• LabVIEW programs are called virtual instruments, or VIs
• Appearance and operation imitate physical instruments,
such as oscilloscopes and digital multimeters

ni.com/training
2
B. Parts of a VI

LabVIEW VIs contain three main components:


1. Front Panel 2. Block Diagram 3. Icon/Connector Pane

ni.com/training
3
B. Parts of a VI – Front Panel
• User interface for
the VI
• You build the
front panel with
controls (inputs) and
indicators (outputs)

ni.com/training
4
B. Parts of a VI – Block Diagram
• Contains the
graphical source
code
• Front panel objects
appear as terminals
on the block diagram

ni.com/training
5
B. Parts of a VI – Icon/Connector Pane
• Icon: graphical representation of a VI
• Connector Pane: map of the inputs and outputs of a VI
• Icons and connector panes are necessary to use a VI as
a subVI
− A subVI is a VI that is inside of another VI
− Similar to a function in a text-based programming
language
Icon Connector Pane

ni.com/training
6
Demonstration

Starting A VI

Demonstrate using the


Getting Started dialog box
GOAL

and the New dialog box


to start a VI.

ni.com/training
D. Project Explorer
Use LabVIEW Projects to:
• group together LabVIEW files and non-LabVIEW files
• create build specifications
• deploy or download files to targets

ni.com/training
8
Demonstration

Project Explorer

Demonstrate creating a project, adding files, and


removing files.
GOAL

ni.com/training
E. Front Panel

ni.com/training
10
E. Front Panel – Controls Palette
• Contains the controls and indicators you use to
create the front panel
• Access from the front panel by selecting
View»Controls Palette

ni.com/training
11
E. Front Panel – Front Panel Toolbar

ni.com/training
12
E. Front Panel – Controls & Indicators
• Controls
− Knobs, push buttons, dials, and other input devices
− Simulate instrument input devices and supply data to the
block diagram of the VI
• Indicators
− Graphs, LEDs, and other displays
− Simulate instrument output devices and display data the block
diagram acquires or generates

ni.com/training
13
E. Front Panel – Numeric Controls/Indicators

The numeric data type can represent numbers of various


types, such as integer or real

Numeric Control
Increment/Decrement Buttons

Numeric Indicator

ni.com/training
14
E. Front Panel – Boolean Controls/Indicators
• The Boolean data type represents data that only has two
parts, such as True and False or On and Off
• Use Boolean controls and indicators to enter and display
Boolean (True or False) values
• Boolean objects simulate switches, push buttons, and
LEDs

Boolean Boolean
Control Indicator

ni.com/training
15
E. Front Panel – Strings
• The string data type is a sequence of ASCII characters
• Use string controls to receive text from the user such as a
password or user name
• Use string indicators to display text to the user

ni.com/training
16
E. Front Panel – Shortcut Menus
• All LabVIEW objects have
associated shortcut menus
• As you create a VI, use the
shortcut menu items to change
the look or behavior of front
panel and block diagram
objects
• To access the shortcut menu,
right-click the object

ni.com/training
17
E. Front Panel – Property Dialog Box
• Right-click a front panel
object and select
Properties to display
• The options available on
the property dialog box
are similar to the options
available on the shortcut
menu for that object

ni.com/training
18
F. Block Diagram

Block diagram objects include the


following:
• Terminals
• SubVIs
• Functions
• Constants
• Structures
• Wires

ni.com/training
19
F. Block Diagram – Functions Palette

Contains the VIs, functions, and constants


you use to create the block diagram

ni.com/training
20
F. Block Diagram – Block Diagram Toolbar

ni.com/training
21
F. Block Diagram – Terminals
• Terminals are:
− Block diagram appearance of front panel objects
− Entry and exit ports that exchange information between the
front panel and block diagram
− Analogous to parameters and constants in text-based
programming languages
• Change the view type of a terminal by toggling the View as
Icon selection from the context menu

ni.com/training
22
F. Block Diagram Terminals

ni.com/training
23
F. Block Diagram – Nodes
• Objects on the block diagram that have inputs and/or
outputs and perform operations when a VI runs
• Analogous to statements, operators, functions, and
subroutines in text-based programming languages
• Nodes can be functions, subVIs, or structures
Nodes

ni.com/training
24
F. Block Diagram – Function Nodes
• Fundamental operating elements of LabVIEW
• Do not have front panels or block diagrams, but do have
connector panes
• Double-clicking a function only selects the function – does
not open it like a VI
• Has a pale yellow background on its icon

ni.com/training
25
F. Block Diagram – SubVI Nodes
• SubVI: VIs that you build to use inside of another VI
• Any VI has the potential to be used as a subVI
• When you double-click a subVI on the block diagram, you
can view the front panel and block diagram of the subVI
− The upper right corner of the front panel and block diagram
displays the icon for the current VI
− This is the icon that appears when you place the VI on a
block diagram as a subVI

ni.com/training
26
F. Block Diagram – SubVI Nodes
• Express VIs are a special type of subVI
− Require minimal wiring because you configure them
with dialog boxes
− Save the configuration of an Express VI as a subVI
• Icons for Express VIs appear on the block diagram
as icons surrounded by a blue field

ni.com/training
27
F. Block Diagram – Icons/Expandable Nodes

ni.com/training
28
F. Block Diagram – Wires
• Transfer data between block diagram objects through wires
• Wires are different colors, styles, and thicknesses,
depending on their data types
• A broken wire appears as a dashed
black line with a red X in the middle

DBL Numeric Integer Numeric String


Scalar
1D Array
2D Array

ni.com/training
29
F. Block Diagram – Wiring Tips
• Press <Ctrl>-B to delete all broken wires
• Right-click and select Clean Up Wire to reroute the wire

ni.com/training
30
Exercise 2-1: Exploring a VI

Concept Exercise
Identify the parts of an existing VI.
GOAL

ni.com/training
G. Searching for Controls, VIs & Functions

Find controls, functions, and VIs using the Search button on


the Controls and Functions palette.

ni.com/training
32
Exercise 2-2: Navigating Palettes

Concept Exercise
Learn to use the palettes and search for controls,
GOAL

functions and VIs.

ni.com/training
H. Selecting A Tool
• Create, modify, and debug VIs
using the tools provided by LabVIEW
• A tool is a special operating mode of the
mouse cursor
• The operating mode of the cursor corresponds to the icon
of the tool selected
• When using the Automatic Tool Selection, LabVIEW
chooses which tool to select based on the current location
of the mouse

ni.com/training
34
Exercise 2-3: Selecting A Tool

Concept Exercise
Gain experience using the Automatic Tool Selection to
GOAL

select which tool to use.

ni.com/training
I. Dataflow

LabVIEW follows a dataflow model for running VIs


• A node executes only when data are available at all of its
input terminals
• A node supplies data to the output terminals only when the
node finishes execution

ni.com/training
36
I. Dataflow – Quiz
Which node executes first?
a) Add
b) Subtract
c) Random Number
d) Divide
e) Sine

ni.com/training
37
I. Dataflow – Quiz Answers
NO CORRECT ANSWER

Which node executes first?


a) Add – possibly
b) Subtract – definitely not
c) Random Number – possibly
d) Divide – possibly
e) Sine – definitely not

ni.com/training
38
Exercise 2-4: Dataflow

Concept Exercise
Understand how dataflow determines the execution order
GOAL

in a VI.

ni.com/training
J. Building a Simple VI

ni.com/training
40
J. Building a Simple VI – Acquire

Acquire Express VIs:

• DAQ Assistant Express VI

• Instrument I/O Assistant Express VI

• Simulate Signal Express VI

• Read from Measurement File Express VI

ni.com/training
41
J. Building a Simple VI – Analyze

Analyze Express VIs:


• Amplitude and Level Measurements Express VI

• Statistics Express VI

• Spectral Measurements Express VI

• Tone Measurements Express VI

• Filter Express VI

ni.com/training
42
J. Building a Simple VI – Present
• Present tasks are Express VIs that perform a function or
indicators that present data on the front panel of the VI
• Indicators include the Waveform Chart, the Waveform
Graph, and the XY Graph
• Express VIs include the Write to Measurement File Express
VI, Build Text Express VI, DAQ Assistant Express VI, and
the Instrument I/O Assistant Express VI

ni.com/training
43
J. Building A Simple VI – Running

1. Place Express VI on the block diagram


2. Configure the dialog box that opens
3. Wire Express VIs together
4. Save and run the VI

The Run button appears broken when the VI you


are creating or editing contains errors

ni.com/training
44
Demonstration

DAQ Signal
Accessory

Demonstrate the different aspects of the DAQ Signal


Accessory.
GOAL

ni.com/training
Exercise 2-5: Simple Acquire, Analyze, and
Present VI

Create a simple VI that acquires data, analyzes data, and


presents the results.
GOAL

ni.com/training
Summary—Quiz
1. Which function executes first:
Add or Subtract?
a) Add
b) Subtract
c) Unknown
2. Which function executes first:
Sine or Divide?
a) Sine
b) Divide
c) Unknown

ni.com/training
47
Summary—Quiz Answers
1. Which function executes first:
Add or Subtract?
a) Add
b) Subtract
c) Unknown
2. Which function executes first:
Sine or Divide?
a) Sine
b) Divide
c) Unknown

ni.com/training
48
Summary—Quiz
3. Which of the following
functions executes first?
a) Random Number
b) Divide
c) Add
d) Unknown
4. Which of the following
functions execute last?
a) Random Number
b) Subtract
c) Add
d) Unknown
ni.com/training
49
Summary—Quiz Answers
3. Which of the following
functions executes first?
a) Random Number
b) Divide
c) Add
d) Unknown
4. Which of the following
functions execute last?
a) Random Number
b) Subtract
c) Add
d) Unknown
ni.com/training
50
Summary—Quiz

5. What are the three parts of a VI?


a) Front Panel
b) Block Diagram
c) Project
d) Icon/Connector Pane

ni.com/training
51
Summary—Quiz Answer

5. What are the three parts of a VI?


a) Front Panel
b) Block Diagram
c) Project
d) Icon/Connector Pane

ni.com/training
52

You might also like