LabVIEW Window

advertisement
Experiment #3
LabVIEW Exercise
Objectives
• Show the components of LabVIEW
• Introduce LabVIEW programming tools
• Creating a LabVIEW application
Data Acquisition
• Data acquisition (DAQ) basics
• Connecting Signals
• Simple DAQ application
DAQ Device
Computer
Sensors
Cable
Terminal Block
Hardware Connections
BNC-2120
SCB-68
SC-2075
LabVIEW Programs Are Called Virtual
Instruments (VIs)
Front Panel
• Controls = Inputs
• Indicators = Outputs
Block Diagram
• Accompanying “program”
for front panel
• Components “wired”
together
VI Front Panel
Panel Toolbar
Boolean
Control
Double
Indicator
Waveform Graph
VI Block Diagram
Thermometer
Terminal
Call to
subVI
Knob
Terminal
Numeric Constant
Temperature
Graph
While Loop
Stop Button
Terminal
Stop Loop
Terminal
Controls and Functions Palettes
Controls
Palette
(Front Panel Window)
Functions Palette
(Block Diagram Window)
Tools Palette
• Floating Palette
• Used to operate and modify
front panel and block diagram
objects.
Automatic Selection Tool
Operating Tool
Scrolling Tool
Positioning/Resizing Tool
Breakpoint Tool
Labeling Tool
Probe Tool
Wiring Tool
Color Copy Tool
Shortcut Menu Tool
Coloring Tool
Status Toolbar
Run Button
Continuous Run Button
Abort Execution
Pause/Continue Button
Text Settings
Align Objects
Distribute Objects
Reorder
Resize front panel
objects
Additional Buttons on
the Diagram Toolbar
Execution Highlighting
Button
Step Into Button
Step Over Button
Step Out Button
Example of a LabVIEW Program
An example of analogue and discrete representation of a time
varying signal
fs = 1/δt = 1 Hz samples/sec sampling frequency
N = 10
sample points
Nδt = 10 sec
period of sampling
fwave = 0.1 Hz
wave frequency
Twave = 1/ fwave
wave period
Note:
fs > 2fwave
satisfies the Nyquist criterion for a correct
representation of wave frequency
fs = 20.1 Hz > 2x10 Hz
δt = 0.051 sec
Digital Signals
A binary digit or bit is a single digit, 0 or 1
A word is a collection of bits, i.e. four bit words, eight bit
words, etc.
A two bit word can have the following possible a cobinations of
bits: 00, 01, 10, 11
M
In general an M bit word can have 2 combinations of bits
Weighing scheme of finding the numerical value of a word:
Bit M-1 …
)M-1 …
(0 or 2
Bit 3
Bit 2
)3
(0 or 2
(0 or 2
)2
Bit 1
)1
(0 or 2
Bit 0
(0 or 2
)0
Example:
What number does 0101 represent?
M=4
3
2
1
0
The number is: 0 +2 +0 +2 = 0+4+0+1 = 5
Note: Special combinations of bits are used for letters,
symbols, sign, etc.
Frequency analysis of a signal
Consider a continuous signal f(t) over a time increment L. The
function f(t) can be extended, using an odd extension, in the
region 0 to –L resulting in a periodic function in (-L,L) with a
period 2L.
F(t)
f(t)
0
L
t
The function can be represented by a Fourier series for 0<t<L:
∞
f(t)= ∑ Bnsin(2πnft)= B sin(2πft)+B sin(4πft)+...
1
2
0
with f = 1/2L , and n = 1, 2, 3, ……
where:
L
2
Bn = ∫ f(t)sin(2πnfx)dt
L0
Each term of the series is a sine wave with magnitude Bn and
frequency n/2L. The Fourier decomposition of the function
can also be represented graphically as a frequency spectrum,
which can be used to reconstruct the function:
Amplitude, Bn
etc
f
2f
3f
5f
Frequency
When acquiring experimental data, signals are discretized by
acquiring over a time increment Nδt by specifying the number
of samples, N, and the sampling rate, fs = 1/δt .
The frequency spectrum (amplitude vs. frequency) of a signal
from discrete data points can be obtained using a Discrete
Fourier Transform method, and the Fast Fourier Transform is
an algorithm used to perform this analysis.
Download