Data Acquisition Practical Session
Antonios Vandoulakis
Technical Sales Engineer
Agenda
Brief introduction to NI and LabVIEW
o
Exercise 1 Working with LabVIEW
Brief introduction to CompactDAQ architecture
o
Exercise 2 Taking measurements with CompactDAQ
Overview on the graphical interface
o
o
Exercise 3 Programming structures in LabVIEW
Exercise 4 Acquire different signals simultaneously
Resources for your application
Questions and comments
National Instruments at a Glance
Leaders in Computer-Based
Measurement and Automation
NI HQ
Long-term Track Record of Growth
and Profitability
Record Revenue: $1.14B in 2013
Fortune 100 Best Companies to
Work For eleven years in a row
More than 6000 employees;
operations in 40+ countries
Founded in 1976 with focus on
Instrument Control
LabVIEW 1.0 released in 1986
Virtual Instrumentation Everywhere
More than 30,000 companies annually, including
>90% of Fortune 500 manufacturing companies
What is LabVIEW?
LabVIEW is a Programming Language such as C/C++,
Visual Basic, .NET, etc.
Graphical programming
For test and measurement and automatization
Import libraries such as DLL, ActiveX
Connects to Hardware I/O
Manage features of O.S. (multicore, etc.)
Graphical Systems Design
Platform-based approach
Test
Desktop and PCbased DAQ
Monitoring
PXI & Modular
Instruments
Embedded
Control
RIO and Custom
Designs
Robotics
Open Connectivity to
3rd party I/O
LabVIEW Everywhere
Graphical Systems Design Platform
Desktop
Real-Time
FPGA
Microprocessor/DSP
Vision
Mobile
Different Hardware Access Modules
Hardware
11
Touch Panel
WSN
LabVIEW Easily Connects to Hardware I/O
6000+ instruments from over 250 vendors
PCI, PCIe, PXI, USB, Ethernet, serial, GPIB, and
CAN devices
Modular data acquisition hardware from DC to
the GHz range
Motion control stages
Cameras
Hundreds of PLCs
12
The LabVIEW Environment
VI = program or function
Front Panel = user interface
Block Diagram = code
13
Controls & Indicators
Knobs/Dials
Graphs/Charts
Buttons
Digital Displays
Sliders
Thermometers
Customize and
create your own
15
Finding Front Panel Objects
Controls Palette
Controls Quick Drop
or
Right-click on Front Panel
Browse by object hierarchy
Press <ctrl + space> to bring up
Search by object name
16
Functions and Express VIs
Configuration Based
Express VI
Standard VIs
17
Dataflow Programming
1 Both Simulate Signal Express VIs execute simultaneously
2 Comparison waits until all inputs are present, then executes
3 Once executed, output from comparison continues through code
18
19
Acquire
Analyze
Present
20
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
DBL Numeric
Integer Numeric
String
Scalar
1D Array
2D Array
21
21
Exercise 1: Create a simple VI in LabVIEW
What will we learn?
Working with LabVIEW environment
Create an application that:
Simulates a signal
Calculate the RMS value
Show the value in the front panel of LabVIEW
23
Data Acquisition
with LabVIEW
24
PC-Based Data Acquisition (DAQ)
29
Measuring Analog Input Signals
Important Factors to Consider
Architecture
To PC
Analog Input
multiplexed
simultaneous sampling
Sampling rate
Resolution
Signal conditioning
30
Analog Input Architectures
Multiplexed
Channel 0
Channel 1
Channel 0
MUX
AMP
ADC
Channel 1
Interchannel delay
Simultaneous sampling
Channel 0 AMP
ADC
Channel 0
Channel 1
Channel 1 AMP
ADC
No interchannel delay
31
NI CompactDAQ
Support more
than 100
modules
Hi-Speed USB 2.0
Integrated Signal
Conditioning
Signal
Connectivity
Hot-swappable modules
33
Exercise 2: Introduction to data acquisition
with LabVIEW
What will we learn
Take measurements using LabVIEW
and NI CompactDAQ
Create an application that
Takes measurements from a
thermocouple and store
measurements into a file
35
Measurement and Automation Explorer
(MAX)
Built-in test panel
DAQmx Task
creation
Device
configuration
and connection
management
windows
Signal connection
diagrams
36
Break
38
Programming in LabVIEW
39
Controlling Program Execution
Start
Is Limit
Met?
Yes
Turn On
Output
No
Reset
Output
Looping (For and While)
Case structure
Sequence structure
State machines
Event structure
State diagram editor
Timed loop
40
LabVIEW Looping Basics
While Loop
For Loop
Run until stop
condition met
Run N times
41
Exercise 3: Execution of a program
What will we learn
How to create an application in
LabVIEW
Create an application that:
Reads temperature from
Thermocouple/RTD
Turn on/off digital lines
42
Parallel Operations with LabVIEW
LabVIEW
LabVIEW
CC*
(does not include code to generate UI)
43
Parallel Operations in LabVIEW
Configuring and visualizing multiple tasks graphically is easier
Analog Output Loop
Parallel loops automatically
take advantage of
multithreading and
multi-core processors for
higher performance
Analog Input Loop
44
Exercise 4: Multiple operations on analog input
channels
What will we learn
Create parallel operations with LabVIEW
Create an application based on
multiple tasks
Acquire Temperature Measurements
Acquire Acceleration Measurements
45
Modules and Toolkits in LabVIEW
46
Dataflow
Text-based
Programming/OOP
Text-based
Mathematics
Simulation
Statechart
Toolkit
Desktop
Real-Time
FPGA
Microprocessor/DSP
Vision
Mobile Touchpanel
Modules
Hardware
47
WSN
PID and Fuzzy Logic Toolkit
PID Control
Autotuning
Gain scheduling
Fuzzy Logic
Control strategies
Decision making
48
Report Generation Toolkit for Microsoft Office
Programmatically create and edit
reports in Microsoft Word and Excel
Populate report templates
Manage report layout, format, and
appearance
E-mail reports and run macros
Express VI included
49
Database Connectivity Toolkit
Insert, select data from OLE DB, ODBC databases
Microsoft Access, SQL Server, Oracle, etc.
Create, drop tables
Save records in XML format
Execute SQL queries
Immediate, parameterized
Execute stored procedures
Accept, reject multiple operations (transactions)
50
LabVIEW Real-Time Module
Rapidly develop
deterministic applications
with graphical
programming
Easily architect distributed
control and monitoring
systems
Eliminate time spent
integrating diverse I/O
51
LabVIEW FPGA Module
Define custom FPGA I/O without VHDL programming
Achieve hardware deterministic response within 25ns
Execute tasks with true parallelism
R Series Intelligent DAQ
NI CompactRIO
52
LabVIEW Touch Panel Module
NI TPC-2006
Create custom human-machine interface (HMI) for Windows XP
Embedded and Windows CE Devices
53
LabVIEW Web UI Builder
Build
LabVIEWbased web
thin clients
Monitor or
control from
your
smartphone
55
NI Vision Development Module
LabVIEW programming libraries for
machine vision and image processing
Includes Vision Assistant
Prototypes and benchmarks applications
Generates complete code for LabVIEW,
Visual Basic, and C
Hundreds of tools to:
Enhance images
Check for presence
Locate features
Identify parts
Measure objects
56
Resources
58
NI LabVIEW Useful Links
What is LabVIEW: www.ni.com/labview
Download LabVIEW: www.ni.com/trylabview
59
Worldwide LabVIEW User Community
Over 50,000 members on awardwinning NI Discussion Forums
NI and LabVIEW user-contributed
blogs
More than 100 LabVIEW User
Groups
Third-party community web sites in
over 15 languages
Hundreds of third-party add-on
tools on the LabVIEW Tools Network
ni.com/labview/community
60
Thank you for your attention!
Questions?