Академический Документы
Профессиональный Документы
Культура Документы
Payman Tehrani
Academic Field Sales Engineer - National Instruments
Our Mission
We equip engineers and scientists with tools that accelerate
productivity, innovation, and discovery.
ni.com 2
Who Chooses NIs Virtual Instrumentation Platform
ni.com 4
ni.com
Large Channel Case Studies
Boeing: 448-channel Microphone Array
200 Hz
Airframe Noise
400 Hz
Inlet Noise
ni.com 6
LabVIEW: Graphical System Design
Statecharts Simulation
ni.com 7
The Foundation of LabVIEW: Virtual Instrumentation
By leveraging COTS PC components, the software becomes the instrument
ni.com 8
National Instruments Strategy: Graphical System Design
ni.com 9
Therefore, LabVIEW Building Blocks Are Called
Virtual Instruments (*.VI)
ni.com 11
Instructor Demo: Using Help Tools
Use Highlight Execution, Context Help and Block
Diagram Cleanup
ni.com 12
Front Panel
ni.com 13
Block Diagram
ni.com 14
Block Diagram
Block diagram items:
Terminals
Constants
Nodes
o Functions
o SubVIs
o Structures
Wires
Free labels
ni.com 15
Context Help
Displays basic
information about
wires and nodes when
you move the cursor
over an object.
Can be shown or
hidden in the following
ways.
o Select HelpShow
Context Help from the
LabVIEW menu.
o Press <Ctrl-H>.
o Click the following
button on the toolbar:
ni.com 16
16
LabVIEW Help
LabVIEW
includes
hundreds of
example VIs.
Use NI Example
Finder to browse
and search
installed
examples.
ni.com 18
18
Examples
ni.com 19
19
Controls Palette
Contains the
controls and
indicators you use to
create the front
panel.
Navigate the
subpalettes or use
the Search button to
search the Controls
palette.
ni.com 20
Functions Palette
ni.com 22
Selecting a Tool
ni.com 23
23
Correcting Broken VIs
ni.com 24
Single-Stepping
ni.com 25
25
Execution Highlighting
ni.com 26
26
With LabVIEW, You Can Program the Way You Think
ni.com 27
With LabVIEW, You Can Program the Way You Think
While Loop
Loop Iteration Terminals
This provides the current loop
iteration count, which ranges from
0 to N-1.
Conditional Terminal
The code within this While Loop will
ni.com
run until a True value is evaluated. 29
The Color, Style, and Thickness of Common Wires
Integer Blue
Boolean Green
String Pink
Error Yellow
ni.com 31
View Terminals as Icons
ni.com 32
Nodes
Nodes are objects on the block diagram that have inputs and/or outputs
and perform operations when a VI runs.
Nodes
ni.com 33
SubVI Nodes
SubVIs :
o Are VIs that you use on the block diagram of another VI.
o Have front panels and block diagrams.
o Use the icon from the upper-right corner of the front panel as the
icon that appears when you place the subVI on a block diagram.
When you double-click a subVI, the front panel and block
diagram open.
Any VI has the potential to be used as a subVI.
ni.com 34
As Complex as You Need
VIs Limited
Hides
unnecessary
Regular details
VIs Retains power
and flexibility
Powerful,
Low-level flexible,
ni.com 35
Building a Simple VI
ni.com 36
While Loops
Repeat (code);
Until Condition met;
End;
ni.com 37
For Loop/While Loop Comparison
ni.com 38
Wait Functions
A wait function inside a loop:
Allows the VI to sleep for a set amount of time.
ni.com 39
Case Structures
Case Selector Label
o Contains the name of
the current case.
Case Selector Label
o Has decrement and
increment arrows.
Selector Terminal
o Letsyou wire an input
value, or selector, to
determine which case
executes.
Selector Terminal
ni.com 40
What Is Data Flow?
Each block diagram node executes only when it receives all inputs
Each node produces output data after execution
Data flows along a path defined by wires
The movement of data determines execution order
ni.com 41
What Is Data Flow?
Each block diagram node executes only when it receives all inputs
Each node produces output data after execution
Data flows along a path defined by wires
The movement of data determines execution order
The [Multiply] and [Subtract] operations can execute at the same time since they
dont have any data dependencies.
ni.com 42
Dataflow Languages Naturally Express Parallelism
The LabVIEW compiler will automatically multithread code expressed in parallel
Task Parallelism
Data Parallelism
ni.com 43
What are Resources?
ni.com 44
Accessing Resources in LabVIEW
Open, Read
Check for
Initialize or and/or Close
Errors
Create Write
ni.com 46
File I/O
Understanding File I/O
File Formats
High-Level File I/O VIs
Low-Level File I/O VIs
ni.com 47
Understanding File I/O
File I/O writes to or reads from a file.
A typical file I/O operation involves the following process:
Open/ Read
Close Check for
Create/ and/or
File Errors
Replace File Write to File
ni.com 48
Understanding Low-Level File I/O VIs
ni.com 49
DAQ Programming Basic Flow
A basic DAQmx application involves the following
process:
Acquire or Check
Create Configure Start Clear
Generate for
Task Task Task Task
Data Errors
ni.com 50
Understanding Modularity SubVIs
ni.com 51
Understanding Modularity SubVIs
ni.com 52
Understanding Modularity SubVIs
ni.com 53
Creating Icons - Icon Editor
Open the Icon Editor using one of these methods:
o Right-click the icon in the upper-right corner of the front panel or
block diagram and select Edit Icon.
o Double-click the icon.
ni.com 54
Parallelism
Execute multiple tasks at the same time
ni.com 55
Variables
ni.com 56
How do the loops stop in this example?
ni.com 57
57
Local Variables
ni.com 58
58
Race Conditions Sequencing
What is the final value?
Four possible outcomes:
Value = (Value * 5) +2
Value = (Value + 2) * 5
Value = Value * 5
Value = Value +2
ni.com 59
Arrays
An array:
Is a collection of data
elements that are of
same type.
Has one or more
dimensions.
Contains up to (231)1
elements per dimension,
memory permitting.
Accesses elements by
its index.
Note: The first element
is index 0.
ni.com 60
Arrays 1D and 2D Examples
ID array
One row of 10-elements
0 1 2 3 4 5 6 7 8 9
1.2 3.2 8.2 8.0 4.8 5.1 6.0 1.0 2.5 1.7
Index
2D array numbers
Five-row by seven-column table of 35
elements
0 1 2 3 4 5 6
0
1
2
3
4
ni.com 61
Common Array Functions
Array Size
Initialize Array
Array Subset
Build Array
Index Array
ni.com 62
Auto-Indexing Input
If the iteration count terminal is wired and arrays of
different sizes are wired to auto-indexed tunnels, the
actual number of iterations becomes the smallest of the
choices.
ni.com 63
63
Charts vs. Graphs Single-Plot
ni.com 64
Why Use Build Specifications?
Use build specifications to build the following:
Stand-alone applications
Installers
Source distributions
Zip files
Shared libraries
Packed Project libraries
.NET Interop Assemblies
Web services
65 ni.com 65
LabVIEW Real-Time Module
LabVIEW FPGA Module
Developing a robust and flexible remote ground CompactRIO used to provide time-critical,
control system to control and monitor the remote-control of rocket fuelling and
Stratos II+ rocket filling and firing procedures launching, and aided the development of one
during both the engine test and the launch of the most powerful hybrid rocket engines
campaigns. ever built by students.
ni.com 67
IMPACT: Stratos II+
The rocket launched to an altitude of
21.5km, setting a new European record
for amateur rocketry
ni.com 68
Colorophone Enabling Visually
Impaired Users to Listen to Light Norwegian Association of the
Blind and Partially Sighted
Developing a novel, low-cost visual sensory Using an NI myRIO to transform light and
substitution device, which transforms visual color into sound. The soundwaves, which mix
information into soundwaves, to help blind values for RGB in the same way the human
people in orientation and identification tasks eye does, are communicated to the wearer
in everyday life. using bone-conduction headphones.
ni.com 69
IMPACT: Colorophone
Having received overwhelmingly positive feedback
from potential users, the students have formed a
startup company to commercialise the colorophone.
ni.com 70
DeepFreezeROV Underwater
Robot for Arctic Research
The Challenge The Solution
Ice algae represents the main food source for Developing a unique, low-cost aquatic robot,
all life beneath the 5 million square km of ice called the DeepFreezeROV. NI myRIO controls
covered Arctic ocean, and significantly the entire robot, from propulsion to bio-
contributes to global CO2 adsorption. sensing. myRIO also processors web-cam
Surprisingly then, this vital organism has rarely images, as part of their unique vision-based
been studied within its own environment. navigation & positioning system.
ni.com 71
Impact: DeepFreezeROV
The data collected on its Artic mission, is
now being used to generate sustainable
fishing quotas and global CO2 models
ni.com 72
Roadrunners Rising from the Ashes
to Set World Record in Fuel Efficiency
The Challenge The Solution
To compete in the Shell Ecomarathon, the Fortunately, the rugged, cRIO-based electronic
students designed and build a urban-concept systems survived the blaze, allowing the team
car, and used NI cRIO as a high-perform ECU to concentrate on rebuilding the vehicle
that controlled all engine and in-vehicle sub- chassis and mechanical components. Within
systems. 48hrs before the race, the car 48hrs, the car was fully restored, and the
caught fire in the Paddock, and was team were able to successfully compete in
destroyed in the blaze. the Ecomarathon.
ni.com 73
IMPACT: DTU Roadrunners
Not onlyImpact: DTUthey won and set
did they compete,
a world-record for fuel-efficiency
ROADRUNNERS
Not only were they able to compete,
they won the Ecomarathon and set a
new world record for fuel-efficiency
ni.com 74
Breath-to-Speech Giving a Voice
Back to Paralysed People
ni.com 75
IMPACT: Breath-to-Speech
This device received ethical approval and
funding from the NHS, and is undergoing
patient-trials in hospital intensive care units
ni.com 76
Project ALAN Remote, Robotic
Rehabilitation for Stroke Survivors
The Challenge The Solution
Leeds researchers used cRIO to develop iPAM, Using the myRIO to control a 3D printed
a robotic rehabilitation system, which can be humanoid arm, capable of operating iPAM for
installed at the homes of stroke survivors. iPAM extended periods of time, in a highly accurate,
improves the convenience and intensity of repeatable and life-like manner. As both the
physio-exercise, and transforms it into highly rehabilitation system and the verification
motivating games. Now, a robust, mechatronic system were developed with a common
verification system is required to accelerate the platform, control, kinematic and processing
time-to-market for this life-changing device. algorithms could be reused throughout.
ni.com 77
IMPACT: Project ALAN
The robotic test arm is so life-like that, when
connected to the web, can enable remote
consultations with live physiotherapists.
ni.com 78