Upload
hoangnga
View
276
Download
6
Embed Size (px)
Citation preview
1
2
LabVIEW 2010Hands-on S ession
For BeginnersZileriu Vlad
S ales Manager RomaniaNational Instruments
3
What You’ll Do Today
• Learn LabVIEW Fundamentals• Acquire S ignals with DAQ Device• Analyze Acquired Data• Write data to file
4
• Leaders in Computer-Based Measurement and Automation
• Long-term Track Record of Growth and Profitability
• Fortune’s “100 Best Companies to Work For” 11 years in a row
• Significant investment in research and development > 18% of revenue in 2009
• More than 5000 employees; operations in more than 40 countries
• LabVIEW 1.0 released in 1986
National Instruments at a Glance
5
Virtual Instrumentation with LabVIEW
Automated Test
Industrial
EmbeddedS oftware-defined
behavior
Modular I/O
6
Virtual Instrumentation Case S tudy
Application
Boeing used LabVIEW and 70 PXI chassis to collect over 300 channels of acoustic data simultaneously in their research to decrease noise during takeoffNI Products
LabVIEW, PXI
"Using NI software and hardware, we were able to create a high-end, low-cost system that could distribute the acquisition system across multiple chassis, tightly synchronize all channels, provide high channel count with full bandwidth on all channels simultaneously, and allow virtually unlimited channel-count expansion. “
-- James Underbrink, Boeing Aero/Noise/Propulsion Laboratory
7
What is LabVIEW?
8
GProgramming
Language
Hardware S upport Analysis and Technical Code
Libraries
Reporting and Data Visualization
Tools
Technology Abstraction
Models of Computation
9
LabVIEW is a Programming Language• Graphical Programming
• Data types• S tructures (i.e. loops, case, event
handling)• S tandard functions (i.e. File I/O)
• Reuse external code• Compiles to machine code• Automatic multithreading
10
LabVIEW is a Development Environment• Debugging tools• Assistants• Configurable functions• I/O Finder• Easy UI Development• S oftware Engineering Tools• Performance Tools
11
LabVIEW Has Built-in Engineering Libraries• In-line and off-line analysis and control
• S ignal processing• Analysis and filtering• Complex math• PID• Vision• Motion
12
LabVIEW Eas ily Connects to Hardware I/O
• 8000+ instruments from over 250 vendors• PCI, PCIe, PXI, US B, E thernet, serial, GPIB,
and CAN devices• Modular data acquisition hardware from DC
to the GHz range• Motion control stages • Cameras• Hundreds of PLCs
13
LabVIEW Fundamentals
14
The LabVIEW Environment“VI” = program or
function
“Front Panel” = user interface “Block Diagram” = code
15
Exercise: Open and Run Final Application
• Explore final application• Acquire, analyze and display the signal
16
Controls & Indicators
• Knobs/Dials• Graphs/Charts• Buttons• Digital Displays• S liders• Thermometers• Customize and
create your own
Front
Panel
17
Finding Front Panel Objects
or
• R ight-click on Front Panel• Browse by object hierarchy
• Press <ctrl + space> to bring up• S earch by object name
Controls Palette Controls Quick
Drop
Front
Panel
18
Functions and Express VIsBlock
Diagram
Configuration BasedExpress VI
S tandard VIs
19
Dataflow Programming
123
Comparison waits until all inputs are present, then executesOnce executed, output from comparison continues through code
Both S imulate S ignal Express VIs execute simultaneously
1 2 3
Block
Diagram
20
• LabVIEW automatically divides each application into multiple execution threads (introduced in 1998 with LabVIEW 5.0)
• Parallel code paths will execute in unique threads
Automatic Multithreading in LabVIEW
thread
thread
thread
Block
Diagram
21
Click to edit Master subtitle style
European Southern Observatory LabVIEW Multicore computing
For a size comparison, two humans and a car stand next to the E-ELT.NI Products
LabVIEWReal-Time module
Application
Control the segmented M1 and flexible M4 mirrors using 3000 (M1) and 8000 (M4) actuators and thousands of sensors. The application runs on 16 x Dell M1000 Eight coreSystems in parallel.
22
Wires and Data Types• Transfer data between block diagram
objects through wires• Wires are different colors, styles, and
thicknesses, depending on their data types• A broken wire appears as a dashed
black line with a red X in the middle
22
S calar1D Array2D Array
DBL Numeric Integer Numeric S tring
Block
Diagram
23
Execution Control S tructuresWhile Loop
For Loop
Run until stop condition met Run N times
• Allow same piece of code to run multiple times• Exit conditions different for each
Block
Diagram
24
Finding B lock Diagram Functions
or
Functions Palette Functions Quick
Drop
• R ight-click on Block Diagram• Browse by object hierarchy
• Press “ctrl + space” to bring up• S earch by object name
Block
Diagram
25
As Complex as You Need
Express VIs
Quick, easy
Limited
RegularVIs
Hides unnecessary details
Retains power and flexibility
Low-levelVIs
Powerful, flexible,
Difficult, time-consuming
Block
Diagram
26
Instructor Demo: Creating a Bas ic VI
• Use basic LabVIEW objects• S imulate signal and display
27
Exercise 2: S imulate S ignal to Graph
• S imulate various signals• Write to Graph
28
Built-in Programming Ass is tance
Highlight Execution
Block Diagram C leanup
Context Help
29
Instructor Demo: Us ing Help Tools
• Use Highlight Execution, Context Help and Block Diagram Cleanup
30
Data Acquis ition with LabVIEW
31
PC-Based Data Acquis ition (DAQ)
32
NI DAQ Platforms
PCI / PCIe PXI / PXIe
US BWireless / E thernet
CompactDAQModular US B
One application, multiple targets
33
Example DAQ S ystemHi-S peed US B 2.0
Or E thernet
Mix and Match over 50 modules
Hot-swappable modulesDirect
sensor connectivity
NI CompactDAQ
Built-in S ignal Conditioning
34
CompactDAQ Door Rattle Noise Analyzer
NI Products
LabVIEW, CompactDAQ
Application
S M Instruments used LabVIEW and CompactDAQ to design a portable “S ound Camera” to analyze unwanted noise in automobile testing.
35
Exercise 3: Taking a Bas ic Measurement
• Acquire the signal• Write to graph
36
Analys is andS ignal Process ing
37
• S ignal Process ing & Analys is
– Waveform Generation– Waveform Conditioning– Waveform Monitoring– Waveform Measurements– S ignal Generation– S ignal Operations– Windows– Digital Filters– S pectral Analysis– Transforms– Point-by-Point
• Mathematics– Numeric– E lementary and S pecial
Functions– BLAS /LAPAC-based Linear
Algebra– Curve Fitting– Interpolation / Extrapolation– Probability and S tatistics– Optimization– Ordinary Differential Equations– Geometry– Polynomial– Formula Parsing– 1D & 2D Evaluation– Calculus
LabVIEW S ignal Process ing, Analys is and Math
38
Using Analys is Functions
Configuration Based
Express VIs
Programmatic, Low-Level VIs
Text-based MathS cript Node
39
Advanced Analys is - Mind/Computer Interface
“LabVIEW simplifies development and encourages innovation by offering an intuitive graphical programming approach; you can focus on innovation rather than programming details.”
- Michael Callahan, CEO, Ambient
NI Products
S ignal Processing in LabVIEWUS B DAQ
www.theaudeo.comApplication
University of Illinois engineering students worked with LabVIEW to develop a device that translates thought into control commands.
40
Exercise 4: Add Analys is and Output
• Acquire signals signal• Add Power S pectrum Analysis
41
Reporting and Data Visualization
42
Data Visualization and Communication• Visualization
• Built-in user interface objects• Charting and graphing
capabilities• Remote application control
• Reporting and Data S torage
• File I/O functionality• HTML reports for the Web• Microsoft Word and Excel
reports
43
LabVIEW S upported S torage Types
• AS C II• Binary• HTML• XML• LVM
• TDM(S ) *• Excel• Word • Datalog• Databases
44
Click to edit Master subtitle style
Fjord & Bælt – Acquire, Analyze and Log acoustic communication of killer whales
“Integration with LabVIEW gives us more functionality for logging, monitoring, and analysis, an d we can display and save results in the same application with the LabVIEW MathScript routine.” - Magnus Wahlburg - Fjord & Bælt
NI Products
LabVIEW, US B data acquisition
Application
Fjord & Bælt simultaneously records 10 signals sampling at 500 kHz each on one laptop for several hours every day, resulting in hundereds of gigabytes of unique data on toothed-whale echolocation. .
45
Exercise 5: Write to File
• Acquire the signal•Perform Analysis•Write to File
46
Software to Interactively Manage, Analyze and Report Measurement Data
DIAdem
NI DataFinderData Index
Search Interface
Measurement Data
Interactive Analysis and Reporting on the Desktop
47
Exercise 6: Reading the Data in DIAdem
• View the Data in NI DIAdem
48
Next S teps
49
LabVIEW Training and Certification Path
ni.com/romania/training
50
Training and Certification Membership Program
Flat rate training program with
ü unlimited access to all scheduled courses for one or two years,
ü personalized training programs,ü option to retake all courses,ü skill validation with professional
credentials,ü and money-back satisfaction
guarantee.
51
Thank you for your attention!
52
Control for S teel Rolling Mill
Images: Integrated Industrial S ystems (I2S )
With NI LabVIEW graphical programming tools, we quickly programmed the FPGA and real-time processor in CompactR IO. Because CompactR IO and our PLCs are Ethernet based, we successfully integrated the CompactR IO PAC with our control systems to optimize our rolling mills with minimal changes to our existing control architecture.
Clark Hummel, I2S
NI Products
LabVIEW, LabVIEW FPGA, cR IO
Application
I2S combined LabVIEW with NI CompactR IO to create a gamma-based, high-speed thickness measurement device to control sheet thickness in a steel rolling mill
53
CompactDAQ S afety helmet crash test
NI Products
LabVIEW, CompactDAQ
Application
S MF used LabVIEW and CompactDAQ to built a safety helmet drop test system for certification purposes.