Introduction to LabVIEW
Why study LabVIEW?
o Graphical Programming is faster
o No need to learn syntaxes
o Out of the box hardware available
o Made code can be reused
o Lots of design Patterns
o Direct code targets for embedded devices
o Processing capability since it has inherent Parallelism
Smart Turf Harvesting Machine
http://sine.ni.com/cs/app/doc/p/id/cs-16758#
Hyundai Wearable Robotics for Walking
Assistance
What is LabVIEW
What is LabVIEW?
LabVIEW is an acronym for Laboratory Virtual Instrumentation Engineering
Workbench
LabVIEW is a graphical, powerful and flexible
instrumentation and analysis software system for
scientists and engineers. LabVIEW uses icons
instead of lines of text to create applications. In
contrast to text-based programming languages, where instructions
determine program execution, LabVIEW uses dataflow programming,
where the flow of data determines execution order
Applications
Acquiring Data and Processing Signals
o DAQ Cards
Controlling Instruments
Automating Test and Validation Systems
Measuring and Controlling Industrial Systems
Designing Embedded Systems
For more applications….check out http://www.ni.com/case-studies/
LabVIEW Program
LabVIEW programs are called Virtual Instruments (VIs) because their
appearance and operation imitate actual instruments. VI’s consists of 3 parts
Front Panel
o The use interface of the VI
Block Diagram
o The actual ‘program’ in the form
of graphical source code
Icon and Connector pane
o For building a Sub VI from a VI
Icon and Connector pane
Every VI has an ICON. An icon is a graphical
representation of a VI
o Draw Custom Picture
o Import Image
o Write Text
A Connector Pane is a set of terminals that
corresponds to controls and indicators of that VI
LabVIEW Interface
Controls Palette
o Present in Front Panel
Functions Palette
o Present in Block Diagram
Tools Palette
o Used to operate or modify the Front
Panel or Block Diagram
Menus, Toolbars, Context Help & Navigation
Menus
VI Toolbar Shortcut Menus
Context
Help
Window
Navigation
Window
The Front Panel
Styles of Controls and Indicators
Modern Style
o16 bit color
o Most number of Options
o Low color available
Classic Style
o 16 or 256 color palettes
o More or less the same
options
System Style
o Ensures Compatibility
o Primitive Controls
Silver Style
Types of Controls and Indicators
Numeric Controls and Indicators
o For entering or displaying Numeric Data which
can be an integer or any real number. The type
of numeric Indicator/ Control decides how to
observe/input data
o Consists of Displays, Slides, Scroll Bars, Rotary Controls etc
Graphs and Charts
o Used for displaying data graphically
o Consists of Waveform ,XY, Intensity, 3D
Surface, Digital Waveform
Graph/Chart etc
Boolean
o Display Boolean True/False values
o Consists of Buttons, Switches and
Lights
Text Entry Boxes, Labels and Path Displays
String
o Input and Display Strings
o Strings can be ASCII, HEX, Password and Special Character
codes
Combo Box Controls
o For creating lists
Paths
o For entering and displaying the path of files
Array, Matrix and Cluster
o For creating Arrays (elements of same type), Matrices(rows & columns of real
complex data for math operations) and Clusters(data of mixed type)
List boxes, Tree Controls, Tables, Enums and Rings
Block Diagram
Terminals
o Front Panel objects appear as Terminals on the Block Diagram
o Entry and Exit points for data
o Can be Icon type or Data type
o LabVIEW supports a number of Icon type
Data types for terminals such
as Boolean, Floating type
numeric, Integer Numeric,
Time Stamp, Enumerated, String, Data type
Array, Cluster, Path etc
Block Diagram Nodes
o Accept inputs and perform operations on them, they
include Functions, SubVI’s, Express VI’s and Structures
Functions
o Built-in execution elements, similar to an
operator or a statement in text based languages
o Consists of Array, Cluster, Boolean, String, Timing
functions etc
SubVIs
o Vis that can be used in the Block Diagram of an other VI,
analogous to Subroutines in text languages
Express Vis
o Designed to aid common
measurement tasks
o Require minimum wiring
Structures
o Used for execution control
o Consists of For, While loops, Case, Flat
and Stacked Sequence Structure etc
Connecting a Block Diagram
o Connected by wires
o Broken Wire by dashes with a red x in the center,
reason for a broken wire appears in a tip strip
o Thickness and color give indication of data
type
o Wire two object using the wiring tool
Segment
Bend
Wire terminology
Coercion Dots
Junction
o Red dots at terminals of blocks
to alert that two different
numeric data types have been
connected. LabVIEW converts
one in to the format of the other.
Block Diagram Execution
o Data flow dependent as compared to Control flow for text
based languages
o With in a Block Diagram execution
starts as soon as data is received
o Can be controlled by using Flow
Through parameters, such as error clusters etc
o Memory allocated as data comes along
Miscellaneous Objects
Decorations Subpalette
o Boxes, Labels, Lines, Circles etc
Box
Label
Example
Converting between Fahrenheit and Centigrade
o C= (F-32)/1.8
o Numerous ways
The Crude approach
o Individual operation blocks
Using Functions Block
o Directly use Functions Block
Car Speedometer
o Calculating Velocity
Boolean equations
Water tank
o Consider the following scenario:
We need to construct a LabVIEW based HMI for a pump supplying water to a residential
colony. The main water tank has two limit switches L1 and L2 at the middle and the brim of the
tank. A main water line comes from the nearby river to fill the tank however a pump is used to
suck the water. The tank is drained when a resident draws water for use. The operation of the
system is as below:
When the water level in the tank is below L1, the pump is turned on to fill the tank.
When the water level in the tank reaches L2, the pump turns off.
Create a LabVIEW based HMI that performs this operation.
Copier
o The block diagram in shows four switches that are part of a control circuitry for a
copy machine. The switches are at various points along the path of the copy paper
as paper passes through the machine. Each switch is normally open, and as the paper
passes over the switch, the switch closes. It is impossible for switches SW1 and SW4 to
be closed at the same time. Design a logic circuit to produce a HIGH output when any two
or more switches are closed at the same time. Use K-map to simplify the expression and
implement it in LabVIEW
SW1
SW2
Logic
SW3 Circuit
??
SW4
Exp: x4(bar)+X4X1(bar)
Check out
LabVIEW Vidoes
http://www.ni.com/academic/students/learn-labview/
Self Paced Learning
http://www.ni.com/academic/students/learn/
LabVIEW exercises
https://lumen.ni.com/nicif/us/acadlvbasics1/content.xhtml
More tech-casts
http://us.ni.com/webcasts/labview-tech
Virtual NIDays
http://us.ni.com/webcasts/nidays