Beruflich Dokumente
Kultur Dokumente
Course 1
Labview 2009-2010
Labview 2009-2010
Labview 2009-2010
Powerful measurement
analysis is built in to the
LabVIEW development
environment.
Labview 2009-2010
Presentation with
LabVIEW can be done
on your PC or over a
network
Labview 2009-2010
Course Goals
Introduction to graphical programming environment
(Front Panel / Block Diagram / Connector/icons)
Labview 2009-2010
Course evaluation
Fields
Files organization
Quality of user interfaces
Quality of programs
Behavior during the course
Labview 2009-2010
Weight
20%
30%
30%
20%
Course Map
Course 1
First steps
with LabVIEW
Course 2
Course 3
Making a decision
Controlling property
Loops
Creation of new VI
and customization
Arrays
Project
Modular
programming
Signal
generation
Saving data
Analyzing and
Data
acquisition
saving
data
Labview 2009-2010
Express VI
Lesson 1
Introduction to LabVIEW
TOPICS
LabVIEW Environment
Front Panel
Block Diagram
Dataflow Programming
Customization of VI
Labview 2009-2010
10
To start
open LV_Getting_Started_Eng_2011.pdf
and follow instructions until page 20 !
Labview 2011-2012
11
Summary
New Dialog Box and Template VIs
Front Panel
Block Diagram
VI, Express Vis, functions, data formats
Front Panel and Block Diagram Tools
Running and Stopping a VI, Toolbars
LabVIEW Documentation Resources
Property Dialog Boxes
Shortcuts
Labview 2011-2012
12
How is composed a
Virtual Instrument (VI)
Front Panel
Controls = Inputs
Indicators = Outputs
Block Diagram
Accompanying program
for front panel
Components wired
together
Labview 2009-2010
13
VI Icon
Simple
Numeric
Indicator
Waveform
Graph
Scale
Legend
Labview 2009-2010
14
Graph
Terminal
Wire
Data
Numerical
Indicator
Terminal
While Loop
Structure
Timing
Function
Labview 2009-2010
Boolean Control
Terminal
15
Labview 2009-2010
16
1D Array
2D Array
Numeric
Boolean
String
Dynamic
Labview 2009-2010
17
Tools Palette
LabVIEW can automatically select the tool needed
Available on the front panel and the block diagram
A tool is a special operating mode of the mouse cursor
Use the tools to operate and modify front panel and
block diagram objects
To show the tools palette, select
WindowShow Tools Palette
Labview 2009-2010
18
Controls Palette
Contains the most commonly used controls
Labview 2009-2010
19
Functions Palette
Contains the Express VIs (interactive VIs with
configurable dialog page) and the most commonly
used functions
Labview 2009-2010
20
Tools Palette
Click pushpin to tack down palette
21
Menu
Labview 2009-2010
22
Font ring
Alignment ring
Abort button
Distribution ring
Pause/Continue button
Resize ring
Reorder ring
Warning indicator
Enter button
Broken Run button
Labview 2009-2010
23
Labview help
1. Information about LabVIEW programming
concepts, step-by-step instructions for using
LabVIEW, and
2. Reference information about LabVIEW VIs,
functions, palettes, menus, tools, properties,
methods, events, dialog boxes, and so on.
Labview 2011-2012
24
Property Page
Right-click a control or
indicator on the front
panel and select
Properties from the
shortcut menu to access
the property dialog box
for that object
Labview 2009-2010
25
Some shortcuts
Labview 2011-2012
26
Lesson 2
Creation of a new VI and customization
TOPICS
New VI creation
Dataflow Programming
Customization of VI
Labview 2009-2010
27
Concepts
Homework
Open a new VI
Build a VI that converts K to F
Save in 1_KtoF.vi
Labview 2009-2010
28
Labview 2009-2010
29
Composition of a new VI
Diagram (D)
Front Panel (FP)
Labview 2009-2010
30
Owned
Labels
Boolean
Control
Labview 2009-2010
Boolean
Indicator
Increment
Buttons
Numeric
Indicator
Numeric
Control
31
Labview 2009-2010
32
Labview 2009-2010
33
Indicator
Control
Block Diagram
Control
Terminal
Labview 2009-2010
Constant
Wires
Nodes
Indicator
Terminal
34
Wiring Techniques
Hot Spot
Automatic Wiring
Use Context Help Window when wiring
Right-click wire and select Clean Up Wire
Tip Strips
Automatic wire routing
Right-click terminals
and select Visible
ItemsTerminals
View the terminal connections to a function
Labview 2009-2010
35
Labview 2009-2010
36
Context Help
To display the Context Help window, select
HelpShow Context Help, press the <Ctrl-H> keys, or press
the Show Context Help Window button in the toolbar
Move cursor over object
to display help
Connections:
Required bold
Recommended normal
Optional - dimmed
Simple/Detailed Context Help
Labview 2009-2010
Lock Help
More Help
37
LabVIEW Help
Click the More Help button in the Context Help window
Select HelpVI, Function, & How-To Help
Click the sentence Click here for more help in the Context
Help window.
Contains detailed descriptions of most palettes, menus,
tools, VIs, and functions, step-by-step instructions for using
LabVIEW features, links to the LabVIEW Tutorial, PDF
versions of all the LabVIEW manuals and Application Notes,
and technical support resources.
Labview 2009-2010
38
Dataflow Programming
Block diagram executes
dependent on the flow of data;
block diagram does NOT
execute left to right
Node executes when data is
available to ALL input terminals
Nodes supply data to all output
terminals when done
Labview 2009-2010
39
Then execute it !
Labview 2009-2010
40
Customization of displays
Goals
Insert comments for users
Adapt displays to the application
Labview 2009-2010
41
1) Free text
Useful to inform user
Authorized on FP et D
In example,
1. Add something like : Temperature conversion .
2. Then, change font, size, color (via FP Toolbar)
Labview 2009-2010
42
2) Customization of displays
Labview 2009-2010
43
Concepts
Free text
Customization of displays
Homework
Open 1_KtoF.vi
Replace numerical indicator with temperature indicator
Insert free text in FP and D to legend them
Save in 2_KtoF.vi
Labview 2009-2010
44
Labview 2009-2010
45
Labview 2009-2010
46
Lesson 3
Modular Programming
TOPICS
SubVIs
Icon and Connector Pane
Using SubVIs
Creating a SubVI from sections of a VI
Labview 2009-2010
47
LabVIEW Hierarchy
SubVI
Labview 2009-2010
48
SubVIs
Function Pseudo Code
main
{
average (point1, point2,
pointavg)
}
Labview 2009-2010
49
Icon/Connector
terminals
Icon
Connector
terminals
Labview 2009-2010
50
Labview 2009-2010
51
Labview 2009-2010
52
Labview 2009-2010
53
Labview 2009-2010
54
Labview 2009-2010
Click with
wiring tool
55
56
Using a VI as a SubVI
All Functions Select a VI
<OR>
Labview 2009-2010
57
Labview 2009-2010
58
Concepts
SubVI
Homework
Create icon and connector of 1_KtoF.vi , save it and close
Create a new VI in order to generate a randomly temperature between T0DT et
T0+DT :
2 inputs T0(K) and DTmax(K)
2 outputs T(K) and T(F)
You have to use the VI 1_KtoF.vi
Save in 3_Gen_temp_conv.vi
Labview 2009-2010
59
60
Exercise 3.1 : D
Labview 2009-2010
61
Exercise 3.2 : FP
Labview 2009-2010
62
Labview 2009-2010
63
Labview 2009-2010
64
Labview 2009-2010
65
Once the creation is achieved, the selected program part becomes an icon.
You can edit it to customize its appearance.
Moreover, if you look at the terminal assignment, it has automatically be
generated. However, you can change it with the method studied in lesson 2.
Labview 2009-2010
66
Exercise 3.2
Goal
SubVI creation
Homework
Open "3_Gen_temp_conv.vi".
Replace the generation part by a subVI.
Customize the SubVI icon.
Suppress the automatic assignment of "T0" and "dTmax"
Save the SubVI as "3Compl1_Gen_temp_conv.vi"
Labview 2009-2010
67
Summary
VIs can be used as subVIs after you make the icon and connector
Icon created using Icon Editor
Connector defined by choosing number of terminals
Load subVIs using the Select a VI option in the All Functions palette
or dragging the icon onto a new diagram
Online help for subVIs using the Show Context Help option
Descriptions document functionality
Use Create SubVI feature to easily modularize the block diagram
Labview 2009-2010
68
Lesson 4
Simple acquisition
TOPICS
Replacing simulation by acquisition
Data acquisition, acquisition of 1 point
Labview 2009-2010
69
DAQ Device
Computer
Sensors
Cable
Terminal Block
Labview 2009-2010
70
ai 0
ai 1
ai 2
Sine Wave 1
Sine Wave 2
Sine Wave 3
Tasks
Timing and Triggering
Labview 2009-2010
71
Labview 2009-2010
NI-DAQmx
Next generation driver:
VIs for performing a
task
One set of VIs for all
measurement types
72
Parameters :
Configuration du terminal : RSE (ground ref.)
Paramtres de cadencement / Mode dacquisition : 1
chantillon sur demande
Labview 2009-2010
73
Concepts
Assistant acquisition data
and hardware
Formula node
Homework
Step 1 : In a blank vi, create an acquisition task, 1point, tension, -10/+10, RSE
Step 2 : Convert the measured voltage into temperature with formula node or express.
Save it as Acq_Temp.vi
Step 3 : Open the vi Sim_temp_conv2.vi and replace the simulation part (specifications
and generation) by the acquisition part and save it in Acq_Temp_conv.vi
Labview 2009-2010
74
Electronic system
Rth = f(Uth) ?
Vcc
R0
Labview 2009-2010
= +10V
= 10 500 Ohms
75
Ref thermistor :
Labview 2009-2010
76
Exercise 4.1 D
Labview 2009-2010
77
Exercise 4.1 FP
Labview 2009-2010
78
Exercise 4.1 D
With subVI
Labview 2009-2010
79
Labview 2009-2010
80
For sure, basic mathematical functions for huge calculus won't be very
practical nor very efficient. They lead to complicated programs, and
Labview propose the use of higher level functions like "expression node"
or "formula node"
Labview 2009-2010
81
Exercise 4.2
Goal
Use of higher level function for mathematical calculus
Creation of SubVI
Homework
Open "4_Acq_Temp_conv.vi"
Replace the Calculus part by a "formula node" or an "expression node"
Create a SubVI performing the acquisition and the conversion.
This SubVI won't have any input terminal and just one output terminal.
Save as "4Compl2_Acq_Temp_conv.vi"
Labview 2009-2010
82