Introduction to Labview (1)
Post on 09-Jan-2016
226 Views
Preview:
DESCRIPTION
Transcript
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 1/32
Introduction to LabVIEWES110
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 2/32
Graphical programming language
& Data flow LabVIEW relies on graphical symbols rather
than textual language to describe
programming actions The principle of dataflow in which functions
execute only after recei!ing the necessary
data go!erns execution in a straightforwardmanner
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 3/32
"ow does LabVIEW wor#$ LabVIEW programs are called%
Virtual Instruments (VIs)
because their appearance and operationimitate actual instruments
"owe!er they are analogous to main
programs functions and subroutines from popular language li#e ' (ortran )ascal *
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 4/32
Front Panel• Controls = Inputs• Indicators = Outputs
Block Diagram• Accompanying “program”
for front panel• Components “wired”
togeter
LabVIEW )rograms +re 'alled Virtual
Instruments ,VIs-
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 5/32
LabVIEW Introduction Two .sets/ for de!elopment
(ront )anel
0loc# Diagram
Wiring connections
LabVIEW 'on!entions
1unning LabVIEW programs
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 6/32
LabVIEW (ront )anel +ll user interface
goes here2
3sed to display
'ontrols or
Indicators
"ighly
customi4able
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 7/32
LabVIEW 0loc# Diagram +ctual program
In!isible to user
1ead left to rightli#e a boo#
Where the5+GI'happens2
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 8/32
TerminalsWhen you place a control
,or indicator - on the
(167T )+7EL
LabVIEW automatically
creates a correspondingcontrol ,or indicator -
terminal on the 0L6'8
DI+G1+5
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 9/32
'ontrol$ or Indicator$
Controls 9 Inputs from the user 9 :ource Terminals
Indicators 9 6utputs to the user 9 Destinations
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 10/32
5anipulating 'ontrols and
Indicators 1ight clic# on an indicator to
'hange to control
'hange format or precision
1ight clic# on a control to
'hange to indicator
'hange mechanical action ,whether to latch
open or closed and what to use as default*-
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 11/32
Wiring 'onnections Wires transport data
through the bloc#
diagram
Wire color indicates
!ariable type
+ red .;/ means
something is wrong2
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 12/32
Wires
+ LabVIEW VI is held together by wires connecting nodes
and terminals< they deli!er data from one source terminal to
one or more destination terminals
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 13/32
0ro#en wiresIf you connect more than
one source or no source
at all to a wire
LabVIEW
DI:+G1EE: with whatyou=re doing and the
wire will appear broken
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 14/32
5essy !s 'lean Wiring
CLEAN: Easy to troubleshoot
MESSY: What is going on?
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 15/32
0asic wires used in bloc# diagrams
and corresponding typesEach wire has different style or color depending on the data
type that flows through the wire%
:calar >D array ?D array 'olor
(loating@pointnumber
orange
Integer number blue
0oolean green
:tring pin#
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 16/32
LabVIEW 'on!entions (ront panel items
'ontrols and indicators
0loc# diagram items )rogram structures ,loops case structures math etc-
'ontrols !s Indicators Wires attach to controls on the right ,gi!e !alues-
Wires attach to indicators on the left ,recei!e !alues-
Wiring colors Wires are color coded to correspond to data types
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 17/32
1unning LabVIEW )rograms +L56:T +LW+A: put
your program in some sort
of loop that can be stoppedwith a control
+V6ID using the red .x/ tostop your program
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 18/32
Lab EBuipment
6scilloscope
(unction Generator
Digital Voltmeter ,DV5-
Universal Measuring
nstru!ents
Signal "enerator
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 19/32
+ddCedit text
Wire features together to
control flow of data
:elect a feature to
edit or mo!e
6perate a control
)robe Data
,troubleshoot-
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 20/32
Insert a digital
indicator or control
Insert a boolean control
,button or switch-
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 21/32
+dd a structure such as forwhile and case statements
+dd a numeric
operator ,@*-
(ile IC6
+dd a boolean
operator ,and or*-
Data +cBuisition
:ignal analysis
'omparison
5athematical
(unctions
TimingCdialog
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 22/32
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 23/32
1eorder
obects
1un
'ontinuous run
)ause:top
(ont ring
+lignment ring
Distribution ring
Debugging features
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 24/32
The 1un 0utton
The 1un button which loo#s
li#e an arrow starts VI
execution when you clic# on it
It changes appearance when a
VI is actually running
When a VI won=t compile the
run button is bro#en
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 25/32
Examples
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 26/32
Control
#er!inals
Block Diagram !indow
Front Panel !indow
n$i%ator#er!inals
'reating a VI
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 27/32
Example >% 'raps
(rom the functions F numeric
panel insert a pair of dice
(rom the 'ontrols panel insert a
numeric digital indicator ,on the
front panel-
3se the wiring tool to connect
the two ,in the wiring diagram-
and clic# the .run/ button
repeatedly
7umbers from to >
should be displayed in the front
panel
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 28/32
Example >% 'raps ,continued-
Delete the wire
+dd a multiplication node and anumeric constant to allowmultiplication by H
+dd an addition node and numericconstant to allow addition of >
+dd a mathematical .1ound to 7earest/ node
5a#e a second copy of thisstructure to represent a second dieand wire them together through anaddition node with an output to anumeric constant
This wiring diagram simulates the rolling
of ? dice and their addition to form a number
from ? through >?
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 29/32
Example ?% +nalog & Digital
Voltmeter (simulated signal)
3niform noise used as simulated signal F(unctions F :ignal )rocessing F :ignalGeneration menu
+bsolute !alue function from functions Fnumeric menu
5ean !alue of data series from thefunctions F mathematics F )robability and:tatistics menu
The ?H ms wait implemented from thetime and dialog menu slows the .flutter/of the meter
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 30/32
Example % 1eading an analog input signal
Requires A/D board to implement (rom the functions menu select
data acBuisition and then
analog input Then select either
.:ample 'hannel/ or :ample
'hannels/
This places the sampling icon
in your wiring diagram
Aou then need to configure the
channel,s- and wire the output
to other parts of your program
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 31/32
Example J% :ignal +nalysis ,continued-
7/17/2019 Introduction to Labview (1)
http://slidepdf.com/reader/full/introduction-to-labview-1 32/32
Example H% 'reating :ub@VIs
In wiring diagram useselection tool ,mouse box- toselect all items to be in the
:ubVI (rom Edit menu select .'reate
:ubVI/
Double clic# on new icon andsa!e it as a separate VI
'ut@and@paste it at will orinsert it using .(unctions F:elect VI menu/
top related