labview lecture 1 - bilkent universityphysics/phys580/files/labview_lecture_1.pdf · labview...
TRANSCRIPT
![Page 1: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/1.jpg)
LabVIEW Lecture 1
Ertugrul Karademir
![Page 2: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/2.jpg)
What is LabVIEW?
• Graphical programming environment
• Measurement, testing, control applications
• Hardware control
• Flowchart representation• Flowchart representation
• Object Oriented Approach
![Page 3: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/3.jpg)
What is LabVIEW?
![Page 4: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/4.jpg)
What is LabVIEW?
![Page 5: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/5.jpg)
Virtual Instrument
• LabVIEW programming paradigm
1. Program control with a front panel
2. Algorithm with block diagram
• Easy to debug
• Hard to program
![Page 6: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/6.jpg)
Front Panel
t
Controls Palette
View > Controls Palette
![Page 7: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/7.jpg)
Block Diagram
Functions Palette
View > Functions Palette
![Page 8: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/8.jpg)
Front Panel – Block Diagram
• To toggle between two panels
Ctrl + E
![Page 9: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/9.jpg)
Context Help
Ctrl + H
![Page 10: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/10.jpg)
Detailed help
![Page 11: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/11.jpg)
Three fashions of variables
• Mixture of GUI and console
1. Controls
– User input (In Java: TextBox GUI Component)
2. Indicators2. Indicators
– Program output (In Java: Label GUI Component)
3. Constants
– Predefined constants (In Java: Class variables
with constconstconstconst definer)
![Page 12: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/12.jpg)
Controls
• Selected from Controls Palette
• Usually Express Palette is
enoughenough
![Page 13: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/13.jpg)
Controls
![Page 14: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/14.jpg)
Controls
• Each control has a proxy in the Block
diagram
• Note that proxy has only OUTPUT node
![Page 15: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/15.jpg)
Indicators
• Also Selected from Controls Palette
• Usually Express Palette is
enoughenough
![Page 16: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/16.jpg)
Indicators
![Page 17: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/17.jpg)
Indicators
• Each indicator also has a proxy in the
Block diagram
• Note that proxy has only INPUT node
![Page 18: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/18.jpg)
Constants
• You can use functions
palette to insert constantspalette to insert constants
![Page 19: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/19.jpg)
Constants
• Constants only live in Block diagram
![Page 20: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/20.jpg)
Search
• You can always seach for the item
• Click on the search button on the palettes
![Page 21: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/21.jpg)
Types
• All standard types are present
– Integer (signed, unsigned, long, word, byte, quad)
– Floating point (single precision, double precision,
extended precision)extended precision)
– Boolean
– String
• All of above can be arranged in arrays,
matrices, clusters
![Page 22: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/22.jpg)
Flow Chart Paradigm
• Flow of execution is done by following nodes
in a flow diagram
NODE NODE NODE NODELEVEL 1
NODE NODE NODE NODELEVEL 2 NODE
And so on...
![Page 23: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/23.jpg)
Wiring
• Defines the direction of flow
NODE
NODE
![Page 24: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/24.jpg)
Wiring
• One to many connection is acceptable
• Many to one connection is illegal
![Page 25: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/25.jpg)
Wiring
• Application of algorithm is done by wiring
• Color of the wire indicates type• Blue: Integer , Orange: Floating Point
• Purple: String, Green: Boolean
Red dot indicates
that “wrong type
has wired but it’s
OK, he has made
the type-casting”.
![Page 26: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/26.jpg)
Algorithm Construction
All algoritm structures lies in Programming
Sub-Palette
![Page 27: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/27.jpg)
Algorithm Construction
Program flow structures are under Structures
Sub-sub-palette
![Page 28: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/28.jpg)
Program Control
PAUSE
RUN RUN
CONTINUOUSLY
STOP
PAUSE
![Page 29: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/29.jpg)
Debugging
HIGHLIGHT
EXECUTION
![Page 30: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/30.jpg)
Debugging
• Broken Arrow Means ERROR
• Click to see Error List
![Page 31: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/31.jpg)
Program Flow Control
• For loops
• While loops
• Sequences
– Flat sequence– Flat sequence
– Stacked sequence
• And many more
• Compansates for: Event handling, Top-to-
bottom execution, OOP, etc.
![Page 32: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/32.jpg)
For loop
• Loop for limited
iterations
• Must know the iteration
amount before-handamount before-hand
• Loop count can-not be
change once set
![Page 33: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/33.jpg)
For loop
Another way to create
variables: Right clicking
onto the node
![Page 34: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/34.jpg)
For loop example
• Get some number from the user
• Add 3 to it 10 times
• Display the result
![Page 35: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/35.jpg)
For loop example
![Page 36: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/36.jpg)
For loop example
Shift registers convey
result of one iteration
to the next iteration
![Page 37: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/37.jpg)
For loop example
![Page 38: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/38.jpg)
For loop example
Do not limit your
imagination
![Page 39: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/39.jpg)
For loop example
User only interacts with three objects
![Page 40: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/40.jpg)
While loop
•Loops until the loop
condition is satisfied
•Or while the loop
condition is not
satisfiedsatisfied
•Select by clicking
on the loop
condition
![Page 41: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/41.jpg)
While loop example
![Page 42: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/42.jpg)
While loop example
Employ boolean and comparison palette
controls to manage loop condition
![Page 43: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/43.jpg)
While loop example
![Page 44: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/44.jpg)
Flat sequence
Executes contents of each
frame one by one
![Page 45: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/45.jpg)
Flat sequence
![Page 46: LabVIEW Lecture 1 - Bilkent Universityphysics/phys580/files/LabVIEW_Lecture_1.pdf · LabVIEW Lecture 1 Ertugrul Karademir. What is LabVIEW? • Graphical programming environment •](https://reader031.vdocuments.net/reader031/viewer/2022021718/5b785f017f8b9a7f378b6992/html5/thumbnails/46.jpg)
Flat sequence