Chapter 1 & 2 LabVIEW-1
Chapter 1 & 2 LabVIEW-1
LABVIEW
BY
MR. S.N
MASONDO
NATIONAL INSTRUMENTS
LABVIEW
NI LabVIEW(short for Laboratory Virtual
Instrument Engineering Workbench) is a
graphical programming software designed for
engineers, with LabVIEW you can
learn firsthand how to:
Create test, control and design applications with
graphical programming.
Acquire, analyse and present real-world data in a
single environment.
Develop programs for desktop, real-time
handheld and in a embedded systems
WHAT IS LABVIEW?
In the past LabVIEW was just a graphical
programming language that was developed
to make it convenient for Engineers to
acquire data from Laboratory instruments
using data acquisition systems.
Now LabVIEW is used not only to acquire
data from outside world but to also process
it, analyze it and give output back to outside
world for controlling instruments and
equipments.
COURSE OBJECTIVES
Become familiar with what LabVIEW is.
How to open LabVIEW
Know what is a LabVIEW VI.
How to use Front panel and block Diagram
How to compute a program
How to run a VI
How to use LabVIEW menus to open and save VIs
GETTING STARTED
Start All programs National
Instruments LabVIEW.
If LabVIEW has been used
recently used there should be
an Icon pined on the Desktop
Start Menu
A getting started LabVIEW window
will pop up.
KEY TERMS
VI Virtual Instrument, is a LabVIEW
program.
Front panel Graphical user interface
Control palette It provides access
to objects(Controls, knobs,
indicators and graphs)
Block diagram Programming block
Function palette It provides
programming functions.
KEY TERMS
Function the functions to be
selected from the function palette..
Control - controls to be selected from
the controls palette
The location within the palette
structure is indicated using slashes
as Main palette/Subpallet/Group/Function
Literal - items meant to be typed on
a text box
BLANK VI
Open Blank VI from Getting Started Window
two sub-windows will pop up first one is your
front panel(graphical users interface) and Block
diagram(programming block).
Example 1:
Demonstration of how to build a simple
introductory VI, Lets build an LED
indicator using a toggle switch, that
illuminates when turned ON.
TOGGLE SWITCH
From front panel click:
Control palette
Express group
Buttons and select toggle switch.
Similar sequence on express group select
LED and add either of the two as provided.
BLOCK DIAGRAM
By adding front panel items, automatically their
respective terminals appear on the block
diagram,
thus, making it easier for you to begin
developing a VI program, in this case you only
connect the two terminals.
RUN
CONTINUOU
SLY
STO
P
VI is ready to RUN.
VI is
running.
VI is broken, cannot run.
Due to error connection on graphical
program
RUNNING THE VI
EDITING A VI
Right clicking on any
control/indicator on front
panel, allows you to edit
their
properties, for instance
in
this case we can edit
the
LED colour OR the
EDITING A VI
Default
settings
EDITING A VI
TOOGLE MACHENICAL
ACTION
The are variety of mechanical actions for
switches
Switch when pressed Toggle switches
Switch when released mouse buttons,
usually
Switch until released doorbell buzzer
TOOGLE MACHENICAL
ACTION
LABVIEW MATHEMATICS
CREATING A VI
Open Blank VI, it allows you to start a
new VI.
Front panel add controls and
Indicator(Num)
Control palette express group Num
controls(2)
Control palette express group Num
indicator
FRONT PANEL
Front panel consist of:
Free text label, to make it comprehensive for
users
Numeric controls, to enter desired values
Numeric indicator, to display acquired result
BLOCK DIAGRAM
Block diagram allows you to compute
graphical
programming, in this caseGraphical
to use math
functions
Comman
d!
to represent the Minuend and
subtrahend
Formula.
Minuend Subtrahend = Diff
MATH FUNCTION
The subtraction math function on block diagram
can be added by simple step:
Function palette Mathematics group Numeric
And choose subtraction function.
INTRODUCTION TO WHILE
LOOP
A while loop is a programming
structure that
causes some program elements to be
evaluated
repeatedly until some condition is
satisfied,
since LabVIEW is a graphical
programming
language, a while loop looks like a
container. The
INDEXING DISABLED
CAUTION
Always save your work.
You will not be allowed to
Connect terminals of the same
kind (e.g. control to control).
Right clicking on a particular
element allows you to change
its orientation(e.g. from
control to indicator)
APPLICATION 1: VOLTAGE
DIVIDER
If you recall voltage divider rule from
Electrical
Engineering 1 it is mathematically
represented
as:
LabVIEW intensifies the circuit Mathematics to
be convenient for Engineers.
Given a circuit diagram
Corresponding to voltage
Divider equation
STEP 2: COMPUTE A VI
PROGRAM
Represent the voltage divider
formula by math functions.
From the equation itself there is:
Addition
Division
Multiplication
APPLICATION 2: QUADRATIC
EQUATION
Given quadratic
equations
Variables a, b and c which can then be
represented by numeric controls on the front
panel. We then expect two numeric indicators
since the equation contains sign, moreover
two numeric indicators will have to be added
to represent X1 and X2.
DOCUMENTING A VI
Labelling a VI is one of the most important part
of documenting a VI, it enables users to re-use
VIs and also for the sake of transparency
makes
it convenient for users to understand how a
particular VI works. To document a VI simply
follow the following steps:
File VI properties on category choose
documenting.
CREATING A DOCUMENT
VI description
DESCRIPTIONS WITH
SUBVIS
A quadratic equation solver is a fairly
generic
piece of a computer code, and it is a good
candidate for subVIs that can be used in
other
VIs. To view your VI details
click on LabVIEW icon on
top right hand corner
and press hold Control+H
CONCLUSION
THANK YOU