Digital Signal Processing with
LabVIEW 8.6
Lab # 02
Constants, Controls, Indicators, datatypes
and Graphs & Charts
Designed by
Adnan Niazi
Lab Engineer
Signal Processing/Signal & Systems Lab
CECOS University of IT & Emerging Sciences
30th- 31st Jan 2009
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Agenda
▌ What is Constant
▌ What is Control
▌ What is Indicator
▌ Types of CTLs and INDs
▌ Where to use what data type?
▌ How to change default representation format
▌ Data flow in LabVIEW
▌ How to write Context Help
▌ What is SubVI. How to use SubVIs
▌ Project Explorer and why use project explorer
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Constant
What is a Constant
▌ Mathematical value that can’t be changed during
execution of a VI (Runtime)
▌ available only in block diagram
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Constants
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Controls
What is a Control
▌ used to change program input during run time
▌ Controls let end users interact with the application
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Controls
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Indicator
What is an Indicator
▌ Indictors are used to display the result
▌ Indictors may be numeric or graphical
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Types of CTLs and INDs
▌ CTLs and INDs fall in three categories
Numeric
Boolean
String
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Where to use what data type? No Need to worry
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
How to change default representation format
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Easy way to change default representation format
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
How to write units to CTLs & INDs
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Deleting Broken wires(Ctrl + B)
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Data flow in LabVIEW
A node produces output data only when all its inputs
arrive at that node. A node is anything which has some
inputs and outputs
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Data flow in LabVIEW
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
How to write Context Help
Why write Context Help
▌ Documentation helps others in understanding your Vis
▌ Code becomes easier to modify in future if its well
documented
▌ Good LabVIEW programmers always document their
code as they build their design
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
How to write Context Help
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Bad Code Example
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
SubVI
Why use SubVIs
▌ SubVIs help in dividing code into manageable chunks
▌ Modular design help in better understanding of the code
▌ Modular code helps in debugging your design
▌ Future changes in the code could me made easily in a
modular design
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
SubVI
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Project Explorer
Why use project explorer
▌ Project explorer helps in effectively arranging and
editing all VIs and SubVIs Related to a project
▌ Its shows hierarchy between parent Vis and SubVIs
▌ Always use project explorer from now on
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Task 1
Design a VI that accepts two numeric inputs, compares
them and then displays whichever input is the greater
one.
Use the VI with in a project explorer
First make the VI without any SubVI and then
encapsulate everything in the block diagram except the
control and indicators in a SubVI
Design context help for everything included in this VI
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Task 1 - Lab report Structure
The lab report for Task 1 must contain
▌ A picture of project explorer with VI included in it
▌ A picture of front panel
▌ A picture of block diagram
After you create the SubVI, then include
▌ A picture of block diagram with SubVI in it
▌ A picture of project explorer with SubVI
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Task 2
Answer the Following questions
▌ What are free label in LabVIEW
▌ What are graphs and what are charts
▌ What is the difference between graph and charts
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Task 2 - Lab report Structure
The lab report for Task 2 must contain
▌ Precise answers to the questions asked
▌ I don’t have any time to read long stories
▌ The shorter the answer is, the better it will be
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Task 3
Run VI to find who has installed LabVIEW on their PC. vi
on your PC
▌ This VI will find out whether you have actually installed
LabVIEW on your Home PC or not
▌ Cheating will be easily caught and the perpetrators
severely punished
▌ So don’t even think about cheating
▌ Just install LabVIEW on your home PC and Run this VI
and print the front panel results
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Task 3 - Lab report Structure
The lab report for Task 3 must contain
▌ Just a picture of the front Panel After you have executed
the VI on your home PC in which you have installed
LabVIEW.
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Add a Table in your Lab Report
You will Receive a WORD file in the Lab 2 folder. Just copy
that table and Paste it at the very top of your Lab Report.
This table will help me in marking your lab Reports
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences
Mind Controlled Wheel Chair from NI Week 07
2008-2009 All rights reserved.
CECOS University of IT & Emerging Sciences