Professional Documents
Culture Documents
LABVIEW
BY
S.ANITHA KUMARI A.P(O.G)
DEPT. OF EIE
Virtual Instrument
LabVIEW works on a data flow model in which information
within a LabVIEW program, called a virtual instrument (VI),
flows from data sources to data sinks connected by wires.
LabVIEW supports two types of VIs--internal VIs and user
created VIs.
Internal VIs are packaged with LabVIEW and perform simple
functions like adding numbers or opening files.
User created VIs consist of both a graphical user interface
called the front panel and a code pipeline called the block
diagram.
FRONT PANEL
Every user created VI
has a front panel that
contains the graphical
interface with which a
user interacts. The front
panel can house various
graphical objects ranging
from simple buttons to
complex graphs. It also
includes nonfunctioning
items such as free labels
and decorations.
Block diagram
Popping-Up on Controls
and Indicators
AutomaticToolSelection AutomaticallyselectsbetweentheOperate
Value,Position/Size/Select,EditTextandConnectWireTools.Itisthe
mostcommonlySelecteditemontheToolsPalette.
OperateValue ManipulatesthevaluesofFrontPanelControlsand
Indicators.GenerallyselectedwhilerunningaVI.
Position/Size/Select SelectsobjectsinaVI,movesthemandresizes
them.
EditText CreatesFreeLabelsontheFrontPanelandeditstheirtext.
AlsoeditstextinOwnedLabels.
ConnectWire WiresBlockDiagramnodesandobjectstogether.
ObjectShortcutMenu Displaysanobject'spopupmenuwiththeleft
mousebutton.
ScrollWindow PansthecontentonaVIwindowwithoutusingthe
window'sscrollbars.
Set/ClearBreakpoint CreatebreakpointsinaVIBlock
Diagramfordebuggingpurposes.BreakpointscausetheVI
tosuspendexecutionataparticularpoint.
ProbeData PlacesProbesonwiresintheBlockDiagramfor
debuggingpurposes.AProbedisplaysthedataonawire
whereitisplaced.
GetColor CopiescolorsfromVIobjectstopastingwiththe
SetColorTool.
SetColor ColorsobjectsinaVIanddisplaystheforeground
andbackgroundcolorsoftheobject.
DATA TYPES
There are three possible data types in a VI
Number- This data type contains numbers that
can be either floating point or integer.
Boolean - This data type contains logical
combinations of TRUE/FALSE, AND, OR, NOT,
Etc.
String - Contains alpha-numeric characters only
All of these data types can be in either Scalar, 1D
Array or 2D Array form.
Wire Types
Numeric Control
Representation
REPRESENTION
Representation
ABBREVATION
Abbreviation
TERMINAL
Terminal
SIZE(BYTES)
Size (bytes)
byte
I8
unsigned byte
U8
word
I16
unsigned word
U16
long
I32
unsigned long
U32
single precision
SGL
double precision
DBL
extend precision
EXT
16
complex single
CSG
complex double
CDB
16
complex extended
CXT
32
CHANGING
REPRESENTATIONS
WIRING
Wires are data flow paths between Block Diagram components.
Block Diagram nodes are wired together for logical functioning of the VI.
Deleting wires:
Creatingwires:selecttheConnectWiretoolonthetoolspalette
Selecting wires:
To quickly and easily make the objects on your Front Panel or Block Diagram nice
and neat.
RUNNING VI
DEBUGGING VIs
ExecutionHighlight
StepOver
StepInto
StepOut
BreakpointTool
ProbeTool
SUB VIs
STRUCTURES
In addition to controls, indicators, and VIs, the block diagram
can also contain a number of programming structures that
modify the sequence of data flow on the block diagram.
LabVIEW currently supports six different structures, -whileloops, case structures, event structures, for-loops, sequence
structures, and formula nodes.
WHILE LOOP
FOR LOOP
Case structures
pseudo code:
If (Condition = Something) Then
Do This
Else
Do That
Endif
Case Structure is configured like a deck of cards. Labview only executes one at a
time. case executed is determined by the value wired to the selector terminal
Creating a Case Structure is much like creating While Loops and For Loops. To create
a Case Structure, Pop-up in the Block Diagram > Structures > Case Structure.
Drag an area for the Case Structure to encompass.
Managing case structure
This function:
Returns the value wired to the t terminal if the value at the s terminal is TRUE
Returns the value wired to the f terminal if the value at the s terminal is
FALSE.
SEQUENCE STRUCTURES
used to control the order of execution of nodes that are not data dependent on each other. The
nodes within each frame are data dependent
The output tunnels of Sequence Structures can only have one data source which, unlike Case
Structures, has outputs that must have one data source per case. The output can come from
any frame, but the data will not leave the structure until the last frame in the structure has
FORMULAE NODE
AFormulaNodeisaboxwhereyouenter
algebraicformulasdirectlyintotheBlock
Diagram.Itisusefulwhenanequationis
complicatedorhasmanyvariables.
CreatingaFormulaNode
ARRAYS
Anarrayisacollectionofdataelements.The
dataelementsinanarraycanbenumeric,
boolean,stringorcluster,butalldata
elementsmustbeofthesametypewithinan
array.Arrayscanbeoneortwodimensional.
ARRAY FUNCTIONS
ARRAYSIZE
INITIALIZE
ARRAY
createsanarrayof
dimensionsize
elementscontaining
theelementvalue.
BUILD ARRAY
linksmultiplearrays.It
appendselementsto
anarray.
itconcatenates
multiplearrays
ARRAYSUBSET
returnsaportionofan
arraystarting
at index and
containing length elem
ents
ARRAY
SEARCHING
searchesthenamearray
forthetargetandreports
ifthetargetisfoundas
wellasitspositioninthe
array.
The outer
loop creates
the row
elements and
the inner loop
creates the
column
elements.
INDEXING
Indexing is a feature that can be enabled for input and output tunnels of both whileloops and for-loop
When an array wire passes into a loop through a tunnel that does not have indexing
enabled, the entire array is placed on the wire and can be accessed during each loop
iteration. When indexing is enabled, only the array element at the index
corresponding to the current loop iteration is available from that tunnel.s by right
clicking on a tunnel.
INPUT INDEXING
OUTPUT INDEXING
Polymorphism
BooleanControls
usually operate like
switches. Most of them
are in the off position
by default (Normally
Open). You can control
the mechanical action
of the Boolean Control
by popping-up on it >
Mechanical Action
SwitchWhenPressed TheControl'svalueischangedeachtimethe
controlispressed.Thisworksmuchlikeastandardlightswitch.
SwitchWhenReleased TheControl'svalueischangedwhenthemouse
buttonisreleased.
SwitchUntilReleased TheControl'svalueischangedwhenthecontrol
isclickedandretainsthatvalueuntilthemousebuttonisreleased.
LatchWhenPressed TheControl'svaluechangeswhenitisclicked,
retainsthatvalueuntiltheVIreadsitonceandthenreverts backtoit's
originalvalue.
LatchWhenReleased TheControl'svaluechangeswhen
themousebuttonisreleased,retainsthatvalueuntilthe
VIreadsitonceandthenrevertsbacktoit'soriginal
value.
LatchUntilReleased TheControl'svaluechangeswhenit
isclicked,retainsthatvalueuntiltheVIreadsitonceor
untilthemousebuttonisreleased,whicheveroccurslast.
Showing a Boolean
Controls State
THANK YOU