LabVIEW Step by Step Guide Final
LabVIEW Step by Step Guide Final
Ashraf AlMadhoun 5
Mechatronic Engineer
110+ Countries
40+ Int. Branches
5000+ Employees
7500+ University
1000+ University in USA
150+ Textbooks
600 Alliance Partners
30000+ Companies
1000+ Products
Ashraf AlMadhoun 6
Mechatronic Engineer
Diversity of Applications
Advanced Food
ATE Military/Aerospace Petrochemical Textiles
Research Processing
Ashraf AlMadhoun 7
Mechatronic Engineer
Ashraf AlMadhoun 8
Mechatronic Engineer
Acquiring data and displaying it using an oscilloscope
Two parallel loops for acquiring data and displaying it using an oscilloscope
Ashraf AlMadhoun 9
Mechatronic Engineer
13Pages ~700Lines
Two parallel loops with different rates for acquiring data and displaying it using
an oscilloscope
Ashraf AlMadhoun 10
Mechatronic Engineer
66Pages ~4000Lines
Ashraf AlMadhoun 12
Mechatronic Engineer
13
Ashraf AlMadhoun 14
Mechatronic Engineer
Data Flow
Block diagram execution is
dependent on the flow of data
Block diagram does NOT
execute left to right
Node executes when data is
available to ALL input terminals
Nodes supply data to all output
terminals when done
If the computer running this
code had multiple processors,
these two pieces of code could
run independently without
additional coding
Ashraf AlMadhoun 15
Mechatronic Engineer
Ashraf AlMadhoun 16
Mechatronic Engineer
What is a Virtual Instrument (VI)?
Answer: a LabVIEW program
1. Front Panel * Conn. pane
available from
User interface (UI) FP only
– Controls = inputs
– Indicators = outputs
2. Block Diagram
Graphical source code
– Data travels on wires from control
terminals through functions to indicator
terminals
– Blocks execute by data flow
3. Icon/Connector Pane
• Graphical representation of a VI
• Means of connecting VIs (subVIs)
Ashraf AlMadhoun 17
Mechatronic Engineer
Ashraf AlMadhoun 18
Mechatronic Engineer
Ashraf AlMadhoun Spring Workshop 2011
19
Mechatronic Engineer 6th Feb - 10th Feb.
Ashraf AlMadhoun 20
Mechatronic Engineer
Ashraf AlMadhoun 21
Mechatronic Engineer
Common Data Types Found in LabVIEW
Ashraf AlMadhoun 22
Mechatronic Engineer
Ashraf AlMadhoun 23
Mechatronic Engineer
LabVIEW Key Features
Faster Programming
– Graphical Programming
Program with drag-and-drop,
graphical function blocks
instead of writing lines of text
– Dataflow Representation
Easily develop, maintain, and understand code with an intuitive
flowchart representation
Ashraf AlMadhoun 24
Mechatronic Engineer
LabVIEW Key Features
Hardware Integration
– I/O and Communication
Connect to any instrument or sensor with built-in libraries and
thousands of instrument drivers
– Plug-and-Play Hardware
Seamlessly integrate NI plug-and-play devices for
USB, PCI, PXI, Wi-Fi, Ethernet, GPIB, and more
Ashraf AlMadhoun 25
Mechatronic Engineer
Report
Generation & Embedded
Data Storage Design
Software
Development Control Design
& Deployment & Simulation
Industrial
Image & Signal
Monitoring
Processing
& Control
26
Embedded Design
Real-Time Module
FPGA Module
Microprocessor SDK
Statechart Module
Mobile Module
DSP Module
Embedded Module for ARM
C-Code Generator
Robotics Module
Ashraf AlMadhoun 27
Mechatronic Engineer
Image & Signal Processing
Vision Development Module
MathScript RT Module
Advanced Signal Processing Toolkit
Digital Filter Design Toolkit
Adaptive Filter Toolkit
Sound & Vibration Measurement Toolkit
Spectral Measurements Toolkit
Modulation Toolkit
Vision Builder for Automated Inspection
Math Interface Toolkit
Real-Time Vision Development Bundle
Ashraf AlMadhoun 28
Mechatronic Engineer
Industrial Monitoring & Control
Data Logging & Supervisory Control
Wireless Sensor Network Module
Touch Panel Module
Motion Assistant
SoftMotion Module
OPC Servers
Instrument Control
Test Automation & Validation
Ashraf AlMadhoun 29
Mechatronic Engineer
LabVIEW Key Features
Multicore Programming
– Automatic Multithreading
Handle large data sets and complex algorithms faster because
LabVIEW inherently runs on multiple threads
– Execution Highlighting
Easily optimize code for parallel execution
using built-in debugging and
Visualization tools
Ashraf AlMadhoun 30
Mechatronic Engineer
Ashraf AlMadhoun 31
Mechatronic Engineer
Ashraf AlMadhoun 32
Mechatronic Engineer
LabVIEW Case Studies
Ashraf AlMadhoun 33
Mechatronic Engineer
Automating a Washing Machine Line Using
LabVIEW and Compact RIO
Ashraf AlMadhoun 34
Mechatronic Engineer
Ashraf AlMadhoun 35
Mechatronic Engineer
Ashraf AlMadhoun 36
Mechatronic Engineer
Ashraf AlMadhoun 37
Mechatronic Engineer
Run LabVIEW
Ashraf AlMadhoun 38
Mechatronic Engineer
LabVIEW Programs Are Called Virtual Instruments
(VIs)
Front Panel
Controls = Inputs •
Indicators = Outputs •
Block Diagram
Accompanying “program” for front •
panel
Components “wired” together •
Boolean
Control Graph
Legend
Waveform
Graph
Plot Scale
Legend Legend
SubVI
Graph
Terminal
Wire
Data
Express VI Standard
VI
Ashraf AlMadhoun | LabVIEW Step By 42
Step Guide
Controls and Functions Palettes
Controls Palette
(Front Panel Window)
Functions Palette
(Block Diagram Window)
Run Button
Control Indicator
Terminals Terminals
Context Help
• Online help
• Lock help
• Simple/Complex Diagram help
• Ctrl + H
Online reference
• All menus online
• Pop up on functions in diagram to access online info directly
What is a subVI?
Making an icon and
connector for a subVI
Using a VI as a subVI
• Function Generator VI
• Same VI, viewed three different ways
• Yellow field designates a standard VI
• Blue field designates an Express VI
Terminal Block
NI-ELVIS
SCB-68
While Loops
• Have Iteration Terminal
• Always Run at least Once
• Run According to Conditional
Terminal
• For Loops
• Have Iteration Terminal
• Run According to input N of
Count Terminal
(Terminal labels
reflect data type)
Bundle
Bundle By Name
Ashraf AlMadhoun | LabVIEW Step By 95
Step Guide
Cluster Functions
Unbundle
Unbundle By Name
Unbundled cluster
in the diagram
error clusters