Slides - LabVIEW 3 Hour Hands-On With myDAQ
Slides - LabVIEW 3 Hour Hands-On With myDAQ
Slides - LabVIEW 3 Hour Hands-On With myDAQ
NI LabVIEW
ni.com
Hardware APIs
Built-in Libraries
Deployment Targets
Technology Abstractions
Programming Approaches
C.
D.
E.
ni.com
NI myDAQ
Configured in Measurement and Automation Explorer
(MAX)
Sound Card
ni.com
NI myDAQ
USB controlled,
bus powered
Analog Input:
2 channels, 200kS/s/ch,
16-bit resolution
Analog Output:
2 channels, 200kS/s/ch,
16-bit resolution
DIO: 8 lines
CTR: 1 counter
Integrated DMM: V, A, Ohm
Power Supply: +5 V, +/15 V
3.5 mm stereo audio jacks
Power
Supply:
+5
V lines,
8 DIO
1 counter
2 AI lines
2 AO lines
Power Supply
+/ 15 V
Audio IN/OUT
Integrated
DMM
ni.com
D
EM
O
ni.com
ni.com
ni.com
Bass
Midtones
Treble
1
2
ni.com
1
3
Analyz
e
Prese
nt
Extract useful
information from your
data with interactive
wizards and more than
600 built-in LabVIEW
measurement analysis
and signal processing
functions.
Visualize results in
graphs and charts.
Create custom user
interfaces and reports
in text files, HTML,
Microsoft Word,
Microsoft Excel, and
more.
ni.com
1
4
Analog
ni.com
1
5
D
EM
VI O
1
7
LabVIEW Environment
ni.com
1
8
Bonus: How
many of the tools
can you name?
ni.com
1
9
Data Types
What are the following data types?
ni.com
2
1
Toolbar
What do the following buttons do?
ni.com
2
2
DAQ Assistant
ni.com
Waveform Chart
2
4
Dataflow Programming
Which VI(s) will execute
first?
ni.com
2
5
Debugging Techniques
How do you use the following debugging
tools?
Execution Highlighting
Error List
Probes
2
6
ni.com
2
7
ni.com
2
8
Keystroke Shortcuts
<Ctrl-H> Activate/Deactivate Context Help Window
<Ctrl-B> Remove Broken Wires from Block Diagram
<Ctrl-E> Toggle between Front Panel and Block
Diagram
<Ctrl-Z> Undo (also in Edit menu)
<Ctrl-T> Tile Front Panel and Block Diagram
Tools Options Set Preferences in LabVIEW
File VI Properties Configure VI Appearance,
Documentation, etc.
Create Control/Constant/Indicator Right-click on
terminal to create
ni.com
2
9
Peak Detection
Convert Time-domain
signals to Frequencydomain signals
Analyze all frequency
components to find the
dominant frequency
In this exercise
Time
FF
T
ni.com
3
0
Estimated Time:
15 minutes
ni.com
3
1
ni.com
4
0
ni.com
4
1
V
ID
EO
C.
D.
ni.com
While Loop
For Loop
Types of Functions
Creating Custom Functions (subVI)
4
2
Good Example
Bad Example
ni.com
D
EM
SubVIs O
4
3
While Loop
ni.com
4
4
For Loop
ni.com
4
5
Drawing a Loop
1. Select the structure
(Programming
Structures)
ni.com
4
6
3 Types of Functions
Express VIs: interactive VIs with configurable dialog page (blue
border)
ni.com
4
7
main
{
average (in1, in2, pointavg)
}
ni.com
4
8
Create SubVI
What are some ways that you can create subVIs?
ni.com
4
9
Connector Pane
ni.com
5
0
Analysis: Filters
ni.com
5
1
ni.com
5
2
ni.com
5
3
ni.com
6
0
V
ID
EO
C.
D.
E.
ni.com
Decision Making
6
1
Demonstration: Arrays
Creating Arrays and Auto-Indexing
ni.com
6
2
D
EM
O
Arrays
ni.com
6
3
Creating an Array
From the Controls Modern Array, Matrix, and
Cluster subpalette, select the Array icon
1.
2.
Empty array
shell as seen on
the block
diagram.
ni.com
6
4
Loops can
accumulate arrays
at their boundaries
with auto-indexing
For loops autoindex by default
While Loops
output only the
final value by
default
How can you
enable/disable
auto-indexing?
ni.com
Auto-Indexing
Enabled
Wire becomes
thicker
1D Array
0 1 2 3 4 5
Auto-Indexing
Disabled
5
6
5
Wire remains
the same size
Waveform Charts
ni.com
6
6
Waveform Graphs
ni.com
6
7
Properties include:
Features include:
ni.com
Size
Color
Plot style
Plot color
Cursors
Scaling
6
8
ni.com
6
9
D
EM
O
Case Structure
ni.com
Select Function
7
0
Tab Control
ni.com
7
1
ni.com
7
2
ni.com
8
0
V
ID
EO
Vs.
ni.com
8
1
D
EM
O
2.
Time Delay
ni.com
Wait (ms)
8
2
File I/O
the function of passing data to and from files
can be binary, text, or spreadsheet
Write/Read LabVIEW Measurements file (*.lvm)
Write to *.lvm file
ni.com
8
3
Karaoke!
Stereo sound has two
channels: left and right
Sound is recorded
using two strategically
placed microphones
Voice is present in both
channels
Subtract left channel
from right channel to
eliminate voice
ni.com
8
4
ni.com
8
5
ni.com
8
6
YouTube Link
ni.com
9
4
V
ID
EO
B.
C.
Shift Register
Local Variables
ni.com
Cluster
Navigator Window
LabVIEW Projects
9
5
Introduction to Clusters
ni.com
9
6
Creating a Cluster
1.
2.
ni.com
9
7
Cluster Functions
ni.com
Bundle By Name
9
8
9
9
Valu
e
Befor
e
Loop
Begin
s
ni.com
First
Iteratio
n
Second
Iteratio
n
1
0
Last
Iteratio
n
Local Variables
ni.com
1
0
ni.com
1
0
LabVIEW Project
Group and organize VIs
Manage hardware and I/O
Manage VIs for
multiple targets
Build libraries and
executables
Manage large LabVIEW
applications
Enable version tracking
and management
ni.com
1
0
ni.com
1
0
2. Virtual
Schematic
Breadboard
4. PCB Layout
ni.com
3. Simulate
6. Compare
5. Test
1
0
Additional Resources
ni.com/students
ni.com/lv101
ni.com/textbooks
Get your own copy of the
LabVIEW Student Edition
ni.com/lv101
ni.com
1
0
ni.com
1
0
ni.com
1
0