week 1 - labview student ambassadors_v1
TRANSCRIPT
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
1/94
TOPICS
ni.com/training
LabVIEW Core 1
1
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
2/94
ni.com/training
What You Need to Get Started
Computer runningLabVIEW 2012 or later
and Windows XP or later
LabVIEW Core 1 Course Manual LabVIEW Core 1 Exercise Manual LabVIEW Core 1 Files (or Course CD)
2
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
3/94
ni.com/training
File Locations
The course installer places the course files in the followinglocation:
Root DirectoryExercises
Solutions
LabVIEWCore 1
3
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
4/94
ni.com/training
Instructional Methods
TopicLecture
Quizzes
Demonstrations
ConceptExercise
DevelopmentExercise
4
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
5/94
ni.com/training
Getting the Most out of this Course
Ask questions! Experiment with hands-on exercises to understand the
methods used Explore solutions Implementations explore a possible solution you may find
a better one
5
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
6/94
ni.com/training
Certifications
Certified LV AssociateDeveloper Exam
Certified LabVIEWDeveloper Exam
Certified LabVIEWArchitect Exam
LabVIEW Core 3LabVIEW Core 1
LabVIEW Core 2
Managing Software
Engineering in LabVIEWAdvanced Architectures
in LabVIEWLabVIEW Connectivity
Object-Oriented Designand Programming in LabVIEW
LabVIEW Performance
LabVIEW Real-Time 1LabVIEW Real-Time 2
LabVIEW Instrument ControlLabVIEW Modular Instruments
LabVIEW FPGADAQ & Signal Conditioning
Other Courses
New User Experienced User Advanced User
6
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
7/94
ni.com/training
Course Learning Map
Lesson 3
Implementing a VI
Lesson 2
Troubleshooting & DebuggingVIs
Lesson 1
Navigating LabVIEW
Lesson 6Managing File and Hardware
Resources
Lesson 5
Creating and Leveraging DataStructures
Lesson 4
Developing Modular Applications
Lesson 8
Solving Dataflow Challengeswith Variables
Lesson 7
Using Sequential and StateMachine Algorithms
7
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
8/94
ni.com/training
Course Goals
This course prepares you to do the following: Solve problems using LabVIEW Develop, debug, and test LabVIEW VIs Use modular programming practices Select, create, and leverage common data structures Use data acquisition and instrument control in LabVIEW
applications Effectively use a state-machine architecture
8
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
9/94
TOPICS
ni.com/training
Lesson 1Navigating LabVIEW
A. What Is LabVIEW?B. Project ExplorerC. Parts of a VI
D. Front PanelE. Block Diagram
F. Searching for Controls, VIsand Functions
G. Selecting a Tool
H. DataflowI. Building a Simple VI
9
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
10/94
ni.com/training
A. What Is LabVIEW?
10
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
11/94
ni.com/training
What Is LabVIEW?
A graphical programming environment used to developsophisticated measurement, test, and control systems.
LabVIEW:
Interfaces with widevariety of hardware Scales across
different targets and
OSs Provides built-in
analysis libraries
11
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
12/94
ni.com/training
LabVIEW Language Characteristics
LabVIEW Core 1Topics
Graphical Dataflow-oriented Compiled Multi-platform
Synchronous
LabVIEW Core 2and Later Topics
Event-driven Multi-threaded Object-oriented Multi-target
Memory-Managed
12
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
13/94
ni.com/training
B. Project Explorer
Project Explorer WindowFiles TypesProject Folders
13
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
14/94
ni.com/training
Project Explorer
Find, access, and organizeproject files
Prevent, detect, and resolveincorrect links
Deploy or download files totargets
Manage code for build options Executables, installers, and zip files
Integrate with source codecontrol providers
14
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
15/94
ni.com/training
LabVIEW Files
Common LabVIEW fileextensions:
LabVIEW project .lvprojVirtual instrument (VI) .viCustom control .ctl
15
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
16/94
ni.com/training
Virtual folder Organizes project items and
does not represent files ondisk
Auto-populating folder Adds a directory on disk to the
project LabVIEW continuously
monitors and updates thefolder according to changesmade in the project and ondisk
Adding Folders to a Project
16
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
17/94
ni.com/training
C. Parts of a VI
Front PanelBlock DiagramIcon
Connector Pane
17
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
18/94
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
19/94
ni.com/training
Parts of a VI Front Panel
You build the frontpanel withcontrols (inputs) and
indicators (outputs).
Front Panel User interface for the VI
19
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
20/94
ni.com/training
Parts of a VI Block Diagram
Front panel objectsappear as terminalson the block diagram.
Block Diagram Contains thegraphical source code
20
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
21/94
ni.com/training
Parts of a VI Icon/Connector Pane
Icons and connector panes are necessary to use a VI as asubVI. A subVI is a VI that appears on the block diagram of another VI. A subVI is similar to a subroutine or function in a text-based
programming language.
Icon Graphical representation of a VI
Connector Pane Map of the inputsand outputs of a VI
21
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
22/94
DEMONSTRATION
Using the Project Explorer and Starting a VI
Open an existing project. Identify the parts of a VI. Create a new project. Add and remove files and folders. Create a new VI.
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
23/94
ni.com/training
D. Front Panel
Controls and IndicatorsObject StylesObject Types
BooleanNumericString
23
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
24/94
ni.com/training
Front Panel
24
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
25/94
ni.com/training
Controls and IndicatorsControls
Input devices Knobs, buttons, slides Supply data to the block
diagram
Indicators Output devices Graphs, LEDs Display data the block diagram
acquires or generates
25
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
26/94
ni.com/training
Front Panel Object Styles
26
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
27/94
ni.com/training
Numeric Controls and Indicators
The numeric data in a control or indicator can representnumbers of various types, such as integer or floating-point.
Numeric indicator
Numeric controlIncrement/Decrement buttons
27
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
28/94
ni.com/training
Boolean Controls and Indicators
The Boolean data type represents data that has only twooptions, such as True/False or On/Off.
Use Boolean controls and indicators to enter and display
Boolean (TRUE/FALSE) values. Boolean objects simulate switches, push buttons, and LEDs.
Booleancontrol
Booleanindicator
28
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
29/94
ni.com/training
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.
29
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
30/94
ni.com/training
E. Block Diagram
TerminalsNodesWires
Context Help
30
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
31/94
ni.com/training
Block Diagram
31
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
32/94
ni.com/training
Block Diagram
Block diagram items: Terminals Constants Nodes
Functions SubVIs Structures
Wires Free labels
32
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
33/94
ni.com/training
Terminals
Same label name
33
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
34/94
ni.com/training
Terminals for Front Panel Objects
Terminals are: Entry and exit ports that exchange information between the
front panel and block diagram.
Analogous to parameters in text-based programminglanguages.
Double-click a terminal to locate the corresponding frontpanel object.
34
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
35/94
ni.com/training
View Terminals as Icons
By default,View as Icon optionenabled.
Deselect View as Icon for a more
compact view.
35
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
36/94
ni.com/training
Nodes
Nodes are objects on the block diagram that have inputsand/or outputs and perform operations when a VI runs.
Nodes
36
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
37/94
ni.com/training
Function Nodes
Functions are: Fundamental operating elements of LabVIEW. Do not have front panels or block diagrams, but do have
connector panes. Has a pale yellow background on its icon.
Double-clicking a function only selects the function.
Functions do not open like VIs and subVIs.
37
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
38/94
ni.com/training
SubVI Nodes
SubVIs : Are VIs that you use on the block diagram of another VI. Have front panels and block diagrams. Use the icon from the upper-right corner of the front panel as
the icon that appears when you place the subVI on a blockdiagram.
When you double-click a subVI, the front panel and blockdiagram open.
Any VI has the potential to be used as a subVI.
38
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
39/94
ni.com/training
Express VIs
Express VIs: Are a special type of subVI. Require minimal wiring because you configure them
with dialog boxes. Save each configuration as a subVI.
Icons for Express VIs appear on the block diagramas icons surrounded by a blue field.
39
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
40/94
ni.com/training
Node View Options
40
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
41/94
ni.com/training
Wires
Wires transfer data between block diagram objects. 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.
Scalar
Floating-point Integer String Boolean
1-D Array
2-D Array
41
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
42/94
ni.com/training
Context Help
Displays basic informationabout wires and nodes whenyou move the cursor over anobject.
Can be shown or hidden inthe following ways. Select HelpShow Context
Help from the LabVIEW menu. Press . Click the following button on the
toolbar:
42
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
43/94
ni.com/training
LabVIEW Help
Contains detailed descriptions and instructions for mostpalettes, menus, tools, VIs, and functions. Can be accessed by:
SelectingHelpLabVIEW Help from themenu.
Clicking theDetailed help link in the
Context Help window. Right-clicking an object
and selecting Help fromthe shortcut menu.
43
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
44/94
ni.com/training
Examples
LabVIEW includeshundreds of exampleVIs.
Use NI Example Finderto browse and searchinstalled examples. Select HelpFind
Examples in the menu. Click the example buttons inLabVIEW Helptopics.
44
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
45/94
GOAL
Group Exercise 1-1Concept: Exploring a VI
Identify the parts of an existing VI.
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
46/94
DISCUSSION
Group Exercise 1-1Concept: Exploring a VI
What are constants and when should you use them? What are free labels and when should you use them?
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
47/94
ni.com/training
F. Searching for Controls, VIs, andFunctions
PalettesQuick DropNI Global Search
47
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
48/94
ni.com/training
Searching for Controls, VIs, and Functions
Ways to find controls, VIs, and functions: Search or navigate the palettes.
Controls palette Functions palette
Search by name of object. Quick Drop dialog box
Search palettes, LabVIEW Help, and ni.com . Search text box in toolbar
48
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
49/94
ni.com/training
Controls Palette
Contains the controls andindicators you use to createthe front panel.
Navigate the subpalettes oruse the Search button tosearch the Controls palette.
49
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
50/94
ni.com/training
Functions Palette
Contains the VIs, functions,and constants you use tocreate the block diagram.
Navigate the subpalettes oruse the Search button tosearch the Functions palette.
50
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
51/94
ni.com/training
Searching with Quick Drop
Lets you quickly find controls,functions, VIs, and otheritems by name.
Press the keysto display the Quick Dropdialog box.
51
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
52/94
ni.com/training
Global Search
Use the Search bar in the top right of the front panel and blockdiagram windows to search palettes,LabVIEW Help, andni.com .
52
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
53/94
DEMONSTRATION
Search for Controls, VIs, and Functions
Configure palettes to customize visible palettes. Search and navigate the palettes. Search for help using global search. Use Quick Drop to search by name.
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
54/94
GOAL
Exercise 1-2Concept: Locating Controls, Functions, and VIs
Learn to use the palettes and search for controls, functionsand VIs.
54
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
55/94
DISCUSSION
Exercise 1-2Concept: Locating Controls, Functions, and VIs
Why would you want to add a function to theFavorites category
in theFunctions palette? Why would you use theQuick Drop dialog box instead of the
Search button on theControls and Functions palettes?
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
56/94
ni.com/training
G. Selecting a ToolSelecting a ToolBlock Diagram Clean-Up
56
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
57/94
ni.com/training
Selecting a Tool
A tool is a special operating mode of themouse cursor.
Create, modify, and debug VIs using thetools provided by LabVIEW.
By default, LabVIEW automatically selectstools based on the context of the cursor.
If you need more control, use theTools palette to select a specific tool. Select ViewTools Palette to open the
Tools palette.
57
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
58/94
ni.com/training
Wiring Tips
Press to delete all broken wires. Right-click and selectClean Up Wire to reroute the wire.
58
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
59/94
ni.com/training
Wiring Tips Clean Up Diagram
Use the Clean Up Diagram tool to reroute multiple wires andobjects and to improve readability.
1. Select a section of your block diagram.2. Click the Clean Up Diagram button on the block diagram
toolbar.
59
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
60/94
ni.com/training
Cloning and Moving Items
Clone an object in Windows using the following steps:1. Select the Positioning tool.2. Press the key while clicking an object.3. Drag the copy to new location.
Move an object using the following steps:1. Select the Positioning tool.2. Click and drag the object to new location.
Note: Avoid cutting and pasting objects as this can impact related items.For example, cutting and pasting a block diagram terminal also moves thefront panel object.
60
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
61/94
DEMONSTRATION
Selecting, Editing, Resizing and Wiring
Select item to move, copy, or delete Edit text Resize an object Wire terminals and nodes
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
62/94
GOAL
Exercise 1-3Concept: Selecting a Tool
Gain experience using the Automatic Tool Selection to selectwhich tool to use.
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
63/94
DISCUSSION
Exercise 1-3Concept: Selecting A Tool
How do you enable automatic tool selection?
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
64/94
ni.com/training
H. Dataflow
64
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
65/94
ni.com/training
Dataflow
LabVIEW follows a dataflow model for running VIs. A node executes only when data are available at all of its
required input terminals. A node supplies data to the output terminals only when the
node finishes execution.
65
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
66/94
ni.com/training
Dataflow Quiz
Which node executes first?a) Addb) Subtractc) Random Numberd) Dividee) Sine
66
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
67/94
ni.com/training
Dataflow Quiz Answers
No single correct answer.
Which node executes first?a) Add Possiblyb) Subtract Definitely notc) Random Number Possiblyd) Divide Possibly
e) Sine Definitely not
67
G E i 1 4
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
68/94
GOAL
Group Exercise 1-4Concept: Dataflow
Identify dataflow execution order in the following blockdiagrams.
G E i 1 4
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
69/94
DISCUSSION
Group Exercise 1-4Concept: Dataflow
Which node executes first? Last?Where are the data dependencies?
Group Exercise 1-4
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
70/94
DISCUSSION
Group Exercise 1-4Concept: Dataflow
Which Express VI executes last?
Group Exercise 1-4
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
71/94
DISCUSSION
Group Exercise 1-4Concept: Dataflow
Which Express VI executes last?
Group Exercise 1-4
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
72/94
DISCUSSION
Group Exercise 1 4Concept: Dataflow
Which Tone Measurementexecutes last?
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
73/94
ni.com/training
I. Building a Simple VI
73
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
74/94
ni.com/training
Building a Simple VI
74
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
75/94
ni.com/training
Acquire Express VIs
DAQ Assistant Express VI
Instrument I/O Assistant Express VI
Simulate Signal Express VI
Read from Measurement File Express VI
75
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
76/94
ni.com/training
Analyze Express VIs
Amplitude and Level Measurements Express VI
Statistics Express VI
Spectral Measurements Express VI
Tone Measurements Express VI
Filter Express VI
76
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
77/94
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
78/94
ni.com/training
Building and Running a VI
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.
78
Exercise 1 5 Part A Group Exercise
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
79/94
GOAL
Exercise 1-5, Part A Group ExerciseSimple Acquire, Analyze, and Present Design
Scenario: Acquire a sine waveform 0.1 seconds. Determine the average value of the waveform. Log the data. Display the data to a graph.
79
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
80/94
Exercise 1-5 Part A Group Exercise
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
81/94
DISCUSSION
Exercise 1-5, Part A Group ExerciseSimple Acquire, Analyze, and Present Design
Which Express VI would you use for following tasks? Acquiring a sine wave from a data acquisition device Determining the average value Logging data to a file Displaying data to a graph Displaying average value
Exercise 1-5 Part B
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
82/94
GOAL
Exercise 1-5, Part BSimple Acquire, Analyze, and Present VI
HOMEWORK
Create a simple VI that acquires data, analyzes data, andpresents the results.
82
Exercise 1-5
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
83/94
DISCUSSION
Exercise 1-5Simple Acquire, Analyze, and Present VI
How do you determine the file path of the generated text file?
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
84/94
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
85/94
ni.com/training
SummaryQuiz Answer
1. Which function executes first: Add or Subtract?a) Addb) Subtract
c) Unknown
8585
S Q i
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
86/94
ni.com/training
SummaryQuiz
2. Which function executes first:Sine or Divide?a) Sineb) Divide
c) Unknown
8686
S Q i A
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
87/94
ni.com/training
SummaryQuiz Answer
2. Which function executes first:Sine or Divide?a) Sineb) Divide
c) Unknown
8787
S Q i
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
88/94
ni.com/training
SummaryQuiz
3. Which of the followingfunctions executes first:Random Number, Add orDivide?
a) Random Numberb) Dividec) Addd) Unknown
8888
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
89/94
S Q i
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
90/94
ni.com/training
SummaryQuiz
4. Which of the followingfunctions executes last:Random Number, Subtract or Add?
a) Random Numberb) Subtractc) Addd) Unknown
9090
S Q i A
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
91/94
ni.com/training
SummaryQuiz Answer
4. Which of the followingfunctions executes last:Random Number, Subtract or Add?
a) Random Numberb) Subtractc) Addd) Unknown
9191
S Q i
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
92/94
ni.com/training
SummaryQuiz
5. What are the three parts of a VI?a) Front panelb) Block diagram
c) Projectd) Icon/Connector pane
92
92
S Q i A
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
93/94
ni.com/training
SummaryQuiz Answer
5. What are the three parts of a VI?a) Front panelb) Block diagram
c) Projectd) Icon/Connector pane
93
93
-
8/10/2019 Week 1 - LabVIEW Student Ambassadors_v1
94/94
End of Week 1