Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
LabVIEW Conce$ts
%
"c&uirin'( sain' and loadin' data
%
)ind and use math and com$le! anal#sis functions
%
Wor* with data t#$es( such as arra#s and clusters
%
+is$la#in' and $rintin' results
-ound Card
% Built into most com$uters
Track A Track A
Track B Track B
Track C Track C
%
5otes on hardware setu$
! ! ! =
,ri'' er in'
!
"C7+C
>%?
@6%AB
=
@?%@A bit
>CB D%@9 >
1s7 s
5I .CI +":
some ! !
.or ta ble
>B*-7s%> G-7 s @B%>BB
D-7s
A%?? D-7s
"I
Band widt h
!
"C7+C
B
>
@>%>? bi t
InstrumentsE
!
"C7+C
@%>
A%@6
@>%@6 bit
5I /-B
+":
=
Ca li br ated
"C
"C or +C
>
"O
Ch annels
>
"I
Ch annels
@>%@6 bi t
"ccur ac #
-ound CardE
E , he abo e tab le ma# no t be re$ r esen t atie of al l de i ce aria t i ons that e!ist i n ea ch c at e'or#
Gra$hical Code
% +ata traels on wires from
controls throu'h functions to
indicators
% Bloc*s e!ecute b# +ataflow
LabVIEW .ro'rams "re Called Virtual Instruments 0VIs2
(Place items on the Front Panel Window)
Indicator:
Numeric Slide
Control:
Numeric
Cu sto mi 6
e .a l ett e
Vi ew
(Place items on the
Block Diagram Window)
Structure:
While Loop
'inding "rrors
"#ecution $ighlighting
Probes
%lick on #roken Run #utton&
Window showing error aears&
%lick on "#ecution $ighlighting #utton' data
!low is animated using #u##les& (alues are
disla"ed on wires&
Right)click on wire to disla" ro#e and it shows
data as it !lows through wire segment&
*ou can also select Pro#e tool !rom Tools
alette and click on wire&
E!ercis e > % "c&uirin' a - i 'nal wit h +" :
Track A&B Track A&B
,his e!ercise should ta*e @C minutes9
+e"stroke Shortcuts
,
-%trl./0 , Acti1ate2Deacti1ate %onte3t /el Window
,
-%trl.B0 , Remo1e Broken Wires From Block Diagram
,
-%trl.40 , Toggle Between Front Panel and Block
Diagram
,
-%trl.50 , 6ndo (Also in 4dit 7enu)
(9 Proerties,%on!igure (9 Aearance:
Documentation: etc&
"9 Loo$s
While Loo$
)or Loo$
B9 )unctions and -ubVIs
,#$es of )unctions
While 8oos
, i terminal counts iteration
, Alwa"s runs at least once
, Runs until sto condition is
met
For 8oos
, i terminal counts iterations
, Run according to inut N o!
count terminal
While Loop While Loop
For Loop For Loop
+rawin' a Loo$
@9 -elect the structure
>9 Enclose code to be re$eated
P9 +ro$ or dra' additional nodes and then wire
0 f r om t he )u nct i ons
.al ett e2
E!$ress VIsG interactie VIs with confi'urable dialo' $a'e 0b l ue b or de r2
-tandard VIsG modulari6ed VIs customi6ed b# wirin' 0cus t omi6able2
)unctionsG fundamental o$eratin' elements of LabVIEWQ no front $anel or
bloc* dia'ram 0 #e l lo w2
"na l #sis
% -i'nal .rocessin'
% -tatistics
% "danced 1ath and )ormulas
% Continuous ,ime -oler
-to ra 'e
% )ile I7O
E!$ress )unctions .alette
.alettes are filled with hundreds
of VIs
Eas# to use
Loo$ ,imin'
B9 -i'nal .rocessin'
1ath-cri$t
"rra#s
Clusters
Waeforms
What ,#$es of Con trols and In di cat ors are
"ailable<
5umer ic +at a
% 5umber in$ut and dis$la#
% "nalo' -liders( +ials( and Gau'es
Boolean +a ta
% Buttons and LE+s
"r r a# F 1at ri ! +a ta
% 5umeric +is$la#
% Chart
% Gra$h
% 8; Gra$h
% Intensit# Gra$h
% P+ 'ra$hG $oint( surface( and model
+ec or at ions
% ,ab Control
% "rrows
Ot her
% -trin's and te!t bo!es
% .icture7Ima'e +is$la#
% "ctie8 Controls
E!$ress Controls .alette
Cha rts % " dd @ d ata $oint at a t ime wit h
histor#
Wa-e.orm chart , secial numeric indicator that can
disla" a histor" o! 1alues
%hart udates with each indi1idual oint it recei1es
'unctions+"#press+*raph Indicators+Chart
Wa-e.orm graph , secial numeric indicator that
disla"s an arra" o! data
?rah udates a!ter all oints ha1e #een collected
7a" #e used in a loo i! (9 collects #u!!ers o! data
'unctions+"#press+*raph Indicators+*raph
Loo$s can accumulate
arra#s at their boundaries
with auto-inde!in'
.ro$erties IncludeG
%-i6e
%
Color
%
.lot -t#le
%
.lot color
)eatures includeG
%Cursors
%
-calin'
Track A,B,&C Track A,B,&C
Cluster
B9 +ata )low Constructs
-hift 4e'ister
C9 -ubVIs
+9 -tate 1achines
E9 Local Variables
)9 .roducer7Consumer
Analogous to struct in %
Order is important
tB I -tart ,ime
; I "rra# of ; ma'nitudes
,wo wa#s to create a Waeform ClusterG
Build Waeform 0absolute t ime2 Cluster 0relat i e ti me2
-hift 4e'ister % "ccess .reious Loo$ +ata
"ailable at left or ri'ht border of loo$ structures
4i'ht-clic* the border and select "d d -h i f t 4e 'is t er
4i'ht terminal stores data on com$letion of iteration
Left terminal $roides stored data at be'innin' of ne!t iteration
Before
Loo$
Be'ins
)irst
Iteration
-econd
Iteration
Last
Iteration
Val ue P
I ni t i al
Va lu e
Conert re$eated functions
and VIs with a sin'le VI
,o$ terminals are usuall# resered for references( such as a file reference
Bottom terminals are
usuall# resered for
error clusters
Create custom icons b# ri'ht-clic*in' the icon in the u$$er ri'ht corner of
the front $anel or bloc* dia'ram and selectin' Ed it Ic on or b# double-
clic*in' the icon
;ou also can dra' a 'ra$hic from an#where in #our file s#stem and dro$ it
on the icon
4efer to the
Icon "rt Glossar# at
ni9com for standard
'ra$hics to use in
a VI icon
While Loo$
Case -tructure
-hift 4e'ister
Se1eral rogramming
techniAues e3ist !or transitioning
!rom state to state in 8a#(94W
using State 7achines
De!ault transition imlies that
a!ter one state: another state
alwa"s !ollows
Transitions #etween two
otential states can #e handled
#" a Select Function
" sin'le control or indicator can be read or written to from more than one
location in the $ro'ram
%
Local Variables brea* the dataflow $aradi'm and should be used s$arin'l#
Crea tin' a Local Variable - Wal* ,hrou 'h
9n this e3amle we will see
how 8ocal (aria#les allow us
to share data #etween
arallel loos& We will
create a rogram that
toggles two searate 84Ds
using one switch& 9t also
stos two loos with one
#utton&
%reate the #lock diagram
and !ront anel as seen to
the right&
Right)click on the Sto
Button in the Front Panel
and change the
7echanical Action to
BSwitch When ReleasedC
since 8ocal (aria#les
cannot store 8atched
data&
.roducer7Con sumer +esi'n .at tern
"9 5ai'ation Window
B9 LabVIEW .roMect
C9 -hared Variable
-hows the current re'ion of iew
com$ared to entire )ront .anel or
Bloc* +ia'ram
Great for lar'e $ro'rams
E Or'ani6e and reduce $ro'ram isual si6e with subVIs
Variable ,#$esG
%
-in'le .rocessG share the data amon' VIs on the local com$uter9
%
5etwor*-$ublishedG communicate between VIs( remote
com$uters( and hardware throu'h the -hared Variable En'ine9
-hared Variable must e!ist within a $roMect librar#9
G.IB
-erial
1odular Instruments
Ima'e "c&uisition
1otion Control
/-B
Ethernet
.arallel .ort
C"5