+ All Categories
Home > Documents > Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front...

Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front...

Date post: 31-Mar-2015
Category:
Upload: maverick-addams
View: 220 times
Download: 2 times
Share this document with a friend
Popular Tags:
52
Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting a Tool I. Dataflow J. Building a Simple VI 1
Transcript
Page 1: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Lesson 2Navigating LabVIEWVirtual Instruments Parts of a VIStarting a VIProject ExplorerFront PanelBlock Diagram

G. Searching PalettesH. Selecting a ToolI. DataflowJ. Building a Simple VI

1

H. Smith
~2.5 hours spent on this lesson, including exercises. This lesson is an introduction to navigating LV; you will later cover implementation.
Page 2: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

LabVIEW programs are called virtual instruments, or VIs Appearance and operation imitate physical instruments,

such as oscilloscopes and digital multimeters

2

A. VIRTUAL INSTRUMENTS (VIS)

Page 3: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

LabVIEW VIs contain three main components:1. Front Panel 2. Block Diagram 3. Icon/Connector Pane

3

B. PARTS OF A VI

Lisa Rivers
update this graphic with XP silver
Page 4: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

User interface for the VI

You build the front panel with controls (inputs) and indicators (outputs)

4

B. PARTS OF A VI – FRONT PANEL

H. Smith
Just discuss how a front panel is the user interface of the VI and contains controls and indicators. A section following this slide concentrates on the front panel in more depth.
Page 5: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Contains the graphical source code

Front panel objects appear as terminals on the block diagram

5

B. PARTS OF A VI – BLOCK DIAGRAM

Page 6: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

6

B. PARTS OF A VI – ICON/CONNECTOR PANE

Page 7: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

DemonstrationStarting A VI

Demonstrate using the Getting Started dialog box and the New dialog box to start a VI.

H. Smith
Demonstrate the ability to start a VI in LabVIEW the following ways:Open a blank VI or projectOpen an existing VI or project and modify itOpen a template to begin a new VI or projectDemonstrate or show opening new, existing, or templates from the Getting Started menu, or using the File menu. When opening an existing VI, choose a complex one so that you can show the Browse dialog box. The project is sufficiently complex. Also cover the New dialog box, which shows pre-built LabVIEW templates.
Page 8: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Use LabVIEW Projects to:group together LabVIEW files and non-LabVIEW files

create build specificationsdeploy or download files to targets

8

D. PROJECT EXPLORER

H. Smith
LabVIEW project files (.lvproj) include: - references to files in the project- configuration information- build information- deployment information- etcUse the Project Explorer window to create and edit LabVIEW projectsSelect File»New Project to display the Project Explorer windowYou also can select Project»New Project or select Empty Project in the New dialog box to display the Project Explorer window
Page 9: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

DemonstrationProject Explorer

Demonstrate creating a project, adding files, and removing files.

Page 10: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

10

E. FRONT PANEL

H. Smith
Point out menu, toolbar, control palette, icon, and front panel objects. This is an introduction only slide...do not go into too much depth.
Page 11: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Contains the controls and indicators you use to create the front panel

Access from the front panel by selecting View»Controls Palette

11

E. FRONT PANEL – CONTROLS PALETTE

Page 12: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

12

E. FRONT PANEL – FRONT PANEL TOOLBAR

Page 13: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

13

E. FRONT PANEL – CONTROLS & INDICATORS

Page 14: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

The numeric data type can represent numbers of various types, such as integer or real

14

E. FRONT PANEL – NUMERIC CONTROLS/INDICATORS

Numeric Indicator

Numeric Control

Increment/Decrement Buttons

H. Smith
In the next few slides, you discuss basic data types: numerics, strings and booleans. Discuss only front panel information here, such as appearance and what type of data you put in the control/indicator.You will discuss representation, mechanical action, and string display types in the next lesson.
Page 15: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

15

E. FRONT PANEL – BOOLEAN CONTROLS/INDICATORS

BooleanControl

BooleanIndicator

H. Smith
You will discuss the use of booleans later, just talk about what they are here.
Page 16: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

16

E. FRONT PANEL – STRINGS

H. Smith
display types covered later, just basic concept here.
Page 17: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

17

Page 18: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

18

Page 19: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Block diagram objects include the following:

Terminals SubVIs Functions Constants Structures Wires

19

F. BLOCK DIAGRAM

Page 20: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Contains the VIs, functions, and constants you use to create the block diagram

20

F. BLOCK DIAGRAM – FUNCTIONS PALETTE

Page 21: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

21

F. BLOCK DIAGRAM – BLOCK DIAGRAM TOOLBAR

Page 22: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

22

F. BLOCK DIAGRAM – TERMINALS

H. Smith
If you would like to, this is an excellent place to have your students change the view type of the terminal.
Page 23: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

23

F. BLOCK DIAGRAM TERMINALS

H. Smith
Discuss the visual difference between controls and indicators on the block diagram, and discuss the difference in operation between controls, constants and indicators. Especially that constants are only available on the block diagram.Right-click to change...
Page 24: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

24

F. BLOCK DIAGRAM – NODES

Nodes

Page 25: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

25

F. BLOCK DIAGRAM – FUNCTION NODES

Page 26: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

26

F. BLOCK DIAGRAM – SUBVI NODES

NI
This is where you describe what a subVI is. In lesson 7, the student will learn how to build a subVI, but should already be very familiar with what they are, and how to use them.
Page 27: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

27

F. BLOCK DIAGRAM – SUBVI NODES

Page 28: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

28

F. BLOCK DIAGRAM – ICONS/EXPANDABLE NODES

Page 29: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

29

F. BLOCK DIAGRAM – WIRES

Scalar1D Array2D Array

DBL Numeric Integer Numeric String

Page 30: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Press <Ctrl>-B to delete all broken wires Right-click and select Clean Up Wire to reroute the wire

30

F. BLOCK DIAGRAM – WIRING TIPS

Page 31: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Exercise 2-1: Exploring a VIConcept ExerciseIdentify the parts of an existing VI.

Page 32: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Find controls, functions, and VIs using the Search button on the Controls and Functions palette.

32

G. SEARCHING FOR CONTROLS, VIS & FUNCTIONS

Page 33: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Exercise 2-2: Navigating PalettesConcept ExerciseLearn to use the palettes and search for controls, functions and VIs.

Page 34: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

34

H. SELECTING A TOOL

Page 35: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Exercise 2-3: Selecting A ToolConcept ExerciseGain experience using the Automatic Tool Selection to select which tool to use.

H. Smith
~10 minutesFirst exercise spent entirely in LabVIEW. They will experience resizing, moving, selecting objects, wiring, etc. Spend extra time here if necessary until students are comfortable with the autotool.
Page 36: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

36

I. DATAFLOW

H. Smith
Notes for instructing: LabVIEW is NOT control flow:Visual Basic, C++, JAVA, and most other text-based programming languages follow a control flow model of program executionSequential order of program elements determines execution orderLabVIEW follows a dataflow model for running VIsA block diagram node executes when it receives all required inputsWhen a node executes, it produces output data and passes the data to the next node in the dataflow pathThe movement of data through the nodes determines the execution order of the VIs and functions on the block diagram
Page 37: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Which node executes first? a) Addb) Subtractc) Random Numberd) Divide e) Sine

37

I. DATAFLOW – QUIZ

H. Smith
There is no right answer to this quiz, but there are some wrong answers. This quiz is intended to encourage students to think about dataflow and its implications...
Page 38: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

NO CORRECT ANSWER

Which node executes first? a) Add – possiblyb) Subtract – definitely notc) Random Number – possiblyd) Divide – possiblye) Sine – definitely not

38

I. DATAFLOW – QUIZ ANSWERS

Page 39: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Exercise 2-4: DataflowConcept ExerciseUnderstand how dataflow determines the execution order in a VI.

H. Smith
<5 minutes. Very short. Only simulation in this exercise. If customers do not seem clear on concept, you may want to open a VI and show what is happening with execution highlighting.
Page 40: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

40

J. BUILDING A SIMPLE VI

H. Smith
Most LabVIEW VIs have three main tasks:Acquiring dataAnalyzing the acquired dataPresenting the resultExpress VIs are designed specifically for completing common, frequently used operations in each of these three task areas
Page 41: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Acquire Express VIs:

DAQ Assistant Express VI

Instrument I/O Assistant Express VI

Simulate Signal Express VI

Read from Measurement File Express VI

41

J. BUILDING A SIMPLE VI – ACQUIRE

Page 42: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Analyze Express VIs:

Amplitude and Level Measurements Express VI

Statistics Express VI

Spectral Measurements Express VI

Tone Measurements Express VI

Filter Express VI

42

J. BUILDING A SIMPLE VI – ANALYZE

Page 43: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

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

43

J. BUILDING A SIMPLE VI – PRESENT

Page 44: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

1. Place Express VI on the block diagram2. Configure the dialog box that opens3. Wire Express VIs together4. Save and run the VI

The Run button appears broken when the VI you are creating or editing contains errors

44

J. BUILDING A SIMPLE VI – RUNNING

Page 45: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

DemonstrationDAQ Signal Accessory

Demonstrate the different aspects of the DAQ Signal Accessory.

Page 46: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

Exercise 2-5: Simple Acquire, Analyze, and Present VICreate a simple VI that acquires data, analyzes data, and presents the results.

H. Smith
~ 25 minutesThis is the first exercise where the students build an entire VI from scratch. It is helpful to cover the Scenario and Design sections as a class, reinforcing the idea of the software development method.
Page 47: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

SUMMARY—QUIZ

1. Which function executes first: Add or Subtract?a) Addb) Subtractc) Unknown

2. Which function executes first: Sine or Divide?a) Sineb) Dividec) Unknown

47

Page 48: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

SUMMARY—QUIZ ANSWERS

1. Which function executes first: Add or Subtract?a) Addb) Subtractc) Unknown

2. Which function executes first: Sine or Divide?a) Sineb) Dividec) Unknown

48

Page 49: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

SUMMARY—QUIZ

3. Which of the following functions executes fi rst?a) Random Numberb) Dividec) Addd) Unknown

4. Which of the following functions execute last?a) Random Numberb) Subtractc) Addd) Unknown

49

Page 50: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

SUMMARY—QUIZ ANSWERS

3. Which of the following functions executes fi rst?a) Random Numberb) Dividec) Addd) Unknown

4. Which of the following functions execute last?a) Random Numberb) Subtractc) Addd) Unknown

50

Page 51: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

5. What are the three parts of a VI?a) Front Panelb) Block Diagramc) Projectd) Icon/Connector Pane

51

SUMMARY—QUIZ

Page 52: Lesson 2 Navigating LabVIEW Virtual Instruments Parts of a VI Starting a VI Project Explorer Front Panel Block Diagram G. Searching Palettes H. Selecting.

5. What are the three parts of a VI?a) Front Panelb) Block Diagramc) Projectd) Icon/Connector Pane

52

SUMMARY—QUIZ ANSWER


Recommended