Professional Documents
Culture Documents
Subject Incharge:
Ms. Princy Randhawa
Assistant Professor
8/31/15
Introduction
What is an Instrument?
Collect the data
Analysis Data
Display Information
e.g. Transducer, Oscilloscopes,
Digital
Multi-meter
8/31/15
Virtual InstrumentationDefinition
To Test, Control and Design
applications making accurate
analog
and digital measurements.
Using VI, can also control
external
hardware devices from desktop
computer and for displaying
unit.
8/31/15
Virtual Instrumentation
Model
Data
Acquisition
(Reference
Data)
Analysis/Contr
ol
8/31/15
Results
Virtual Instrumentation-Architecture
User Interface-Display and
Control
Medical
Informatio
n
System
Interface
Processing
Module
Data
Base
Interface
Sensor Interface
Sensor
SensorModule
Module
Sensing
(or
Transducer)
Sensing (or Transducer)
Signal
Signalconditioning
conditioning
A/D
conversion
A/D conversion
8/31/15
Historical Perspective
Analog
Measurement Devices
Data Acquisition and Processing
Devices
Digital processing based on
general purpose computing
platform
Distributed virtual
instrumentation
8/31/15
Distributed Virtual
Instrumentation
Extranet
Internet
WAP
Gatew
ay
Mobile
Telephony
Information
System
Interface
SMS
Gateway
8/31/15
Private
Networks
Contd
8/31/15
Contd
Internet
8/31/15
Contd
Cellular Networks
Wireless Access Protocol (WAP) is platform-independent
wireless technology, which enables mobile devices to
effectively access Internet content and services, as well
as to communicate with each other.
Emergency WAP push, which sends WML messages to
physicians or medical call enter in case of medical
emergency.
8/31/15
10
Traditional Vs Virtual
Instruments
Traditional Instruments
Virtual Instruments
Vendor-defined
User-defined
Expensive
Low-cost, reusable
11
Advantages of VI
Performance
Platform-Independent
Nature
Flexibility
Lower
Cost
Plug-In and Networked Hardware
The Costs of a Measurement Application
Reducing System Specification Time Cost
Lowering the Cost of Hardware and Software
Minimizing Set-Up and Configuration Time
Costs
Decreasing Application Software
development Time Costs
8/31/15
12
LABVIEW-Introduction
Laboratory
Virtual
Instrument
Engineering
Workbench (Lab VIEW)
Lab VIEW 1.0 was launched in 1986.
Lab VIEW is a graphical programming language (G)
that uses icons instead of lines of text to create
applications.
Lab VIEW Programs Are Called Virtual Instruments
(VIs) because their appearance and operation
imitate physical instruments like Oscilloscopes,
Digital Multi-meter.
Lab VIEW contains a set of VIs and functions for
acquiring , analyzing , displaying and storing data.
8/31/15
13
Contd
It includes analysis functions for differential
equations,
optimization,
curve
fitting,
calculus, linear algebra, statistics and so on.
It also includes the tools to present the data
on the
computers: Charts, Graphs, Tables, Gauges,
14
8/31/15
15
Contd.
Figure 1.1 The Space Industries Sheet Float Zone Furnace is used
for high-temperature superconductor materials processing
research in a microgravity environment aboard the NASA KC-135
parabolic aircraft. Lab VIEW controls the industrialized Mac OSbased system.
8/31/15
16
User Interface
Easy to use and Learn
Drag and Drop built-in functions
Modular Design and hierarchical design
Multiple high level development tools
Professional Development tools
Multi platforms
Reduces Cost and preserves investment
Flexibility and scalability
Connectivity and Instrument control
Open Environment
Distributed Development
Visualization capabilities
Rapid development with express technology
Compiled language for fast execution
Simple application distribution
Target management
Object Oriented Design
Algorithm Design
8/31/15
17
Manufacturin
Manufacturin
g
g
Test
Test
Research
Research
and Design
and Design
Manufacturi
Manufacturi
ng
ng
8/31/15
18
Graphical Programming
8/31/15
19
Conventional Language
VI
Program
Function
Function or Method
Sub VI
front panel
user interface
Block Diagram
Program Code
8/31/15
20
Panel
Controls = Inputs
Indicators = Outputs
Block
Diagram
8/31/15
21
Front Panel
The front panel is the user interface of the VI.
You build the front panel with controls and
indicators, which are the interactive input and
output terminals of the VI, respectively.
Controls are knobs, push buttons, dials, and
other input devices. Indicators are graphs,
LEDs, and other displays.
Controls simulate instrument input devices
and supply data to the block diagram of the
VI. Indicators simulate instrument output
devices and display data the block diagram
acquires or generates.
8/31/15
22
8/31/15
23
Block Diagram
Node
Terminal
Wire
8/31/15
24
8/31/15
25
Tools Palette
8/31/15
26
Controls Palette
8/31/15
27
Functions Palette
8/31/15
28
Status Toolbar
Run Button
Continuous Run
Button
Abort Execution
Pause Button
Text Settings
Align Objects
Distribute Objects
Reorder
Resize front panel
objects
8/31/15
29
8/31/15
30
Node
Nodes
8/31/15
31
8/31/15
32
Examples
Divide two numbers and find the remainder
and quotient.
Convert Celsius to Fahrenheit.
Find whether the given number is odd or
even.
Convert a binary number to a decimal
number.
Compute the given equations (X1+2)*log(X1)
using functions, Expression node and Express
formula for the given inputs.
Add two binary numbers and find the sum
and carry( half adder).
8/31/15
33
Creating SUBVIs
Advantages
Modular
Easier to debug
Dont have to recreate code
Require less memory
8/31/15
34
Icon
Terminals
8/31/15
35
the Icon
Create the Connector
Assign Terminals
Save the VI
Insert the VI into a Top Level VI
8/31/15
36
8/31/15
37
8/31/15
38
Assign Terminals
8/31/15
39
Saving the VI
8/31/15
40
Examples
Create a VI to find the average
of two numbers and convert a
section of VI into SubVI.
Create a VI to find roots of a
quadratic equation using SubVIs .
Find both the values of roots and
the nature of roots.
8/31/15
41
Programming Concepts
of VI
Control
42
Loops
The For Loop differs from the While Loop in that the
For Loop executes a set number of times.
FOR Loop
8/31/15
While
43
Drawing Loops
Wire
8/31/15
44
45
Wait Functions
Wait until next ms Multiple
Functions Time & Dialog
palette
8/31/15
46
Contd.
Wait (ms)
FunctionsTime & Dialog palette
Time Delay
8/31/15
47
Value
3
Initial Value
Before Loop
Begins
First
Iteration
Second
Iteration
8/31/15
Last Iteration
48
Right-click
the
left terminal
to add new
elements
8/31/15
49
Feedback Nodes
Appears
8/31/15
50
Contd
Wire from output to input to automatically create a
feedback node
OR
Place a feedback node from the FunctionsStructures
palette
8/31/15
51
52
Contd.
A
53
Contd
Global
8/31/15
54
Encode Message
Program
8/31/15
55
8/31/15
56
Decode Message
Program
8/31/15
57
Examples
8/31/15
58
Arrays
An
8/31/15
59
Element 2.4
6.7
4.8
1.4
3.6
7.4
1.3
60
Arrays in LabVIEW
Arrays
can be created
on the block diagram
On block diagram select
arrays sub palette
Select array constant
and drag onto block
diagram
This creates an array
shell
8/31/15
61
index
elements
8/31/15
62
8/31/15
63
8/31/15
64
3-dimensional Array
Index
(0,0,3)
8/31/15
65
8/31/15
66
array shell
67
Array Functions
Build an array
Size an array
Form an array from a cluster or a cluster
into an array
Index an array
Find the max an min of an array
Insert and delete from an array or reshape
Sort a lD array
Convert an array to matrix, or a matrix to
array
8/31/15
68
multiple arrays or
appends elements to an ndimensional array.
Sizing an array just shows the
number of elements in the array
on the front panel.
Index Array
Returns the element or sub-array of ndimension array at index.
When you wire an array to this function,
the function resizes automatically to
display index inputs for each dimension in
the array you wire to n-dimension array.
You also can add additional element or
sub-array terminals by resizing it.
Sorting an Array
Returns
Converting an Array to a
Matrix
Converts
an array to a matrix of
elements of the same type as the
array elements .
Can make each of the following
* to real matrix
* to column vector
* to complex matrix
* to complex column vector
Auto indexing
LabVIEW
Visual Programming
Arrays in LabVIEW
75
Array Indicator
Visual Programming
Arrays in LabVIEW
76
Arrays in LabVIEW
77
Manipulating Arrays
Many
functions for
working with arrays
initialize array
initial value
for all elements
Visual Programming
Arrays in LabVIEW
78
output is size
of array
Visual Programming
Arrays in LabVIEW
79
array
index
index Index Array
Visual Programming
Replace Array
Subset
Arrays in LabVIEW
80
Clusters
Data
8/31/15
81
8/31/15
82
Building a Cluster
Clusters
Bundling and
Unbundling
Assembles
cluster
from
individual
elements.
It can also be use to change the values of
individual elements in an existing cluster
without having to specify new values for all
elements. To do so, wire the cluster you want
to change to the middle cluster terminal of
this function. When you wire a cluster to this
function, the function resizes automatically
to display inputs for each element in the
cluster. Also when you wire to the middle
terminal, all other inputs are optional.
Indexing A Cluster
Indexes
Cluster Order
Elements have a
To change order,
86
Overcomes
28terminal limit
Simplifies
87
wiring
Bundle
By
Name
Bundle
cluster
Must have an
existing cluster to
use this function.
88
Unbundle
Unbundle By Name
89
Error Cluster
Use the error in and error out clusters in
each VI you use or build to handle errors in
the VI.
The error clusters located on the
ControlsArray & Cluster palette include
the components of information shown.
90
91
92
Plotting Data
Waveform Charts
8/31/15
93
Waveform Charts
94
Wiring to Charts
Single-Plot Chart
Multiple-Plot Chart
95
Modifying Chart
Properties
Change the
appearance
Set the format
and precision
of the axis
Choose the
plot type
Edit the scales
Document the
chart
96
Graph
Palette
Zoom
Subpalette
Scale
Legend
97
Graphs
Selected from the Graph subpalette
Waveform Graph Plot an array of
numbers against their indices
XY Graph Plot one array against
Plot Legend
another
(point and
line styles)
Graph
Palette
Scale Legend
98
Uniform X axis
you specify point
spacing
99
Each row is a
separate plot:
Bundle specifies
point spacing of
the X axis
100
XY Graphs
Non-uniform X axis
Separate X and Y
arrays
define data points
101
Useful
102
Summary
The waveform chart is a special numeric
indicator that displays one or more plots.
The waveform chart has the following three
update modes:
A strip chart shows running data continuously scrolling
from left to right across the chart.
A scope chart shows one item of data, such as a pulse or
wave, scrolling partway across the chart from left to the
right.
A sweep works similarly to a scope except it shows the old
data on the right and the new data on the left separated by
a vertical line.
Structures
Structures are graphical representations of
the loops and case statements of text
based programming languages.
In text based programs, this can be
accomplished with statements like if else,
case and so on.
Decision making with the select function.
8/31/15
10
If
Structures..
For Loop
8/31/15
10
Case Structure
8/31/15
10
108
String Case
109
Sequence Structure
Flat Sequence Structure:
It
displays all the frames at once and executes
the frames from left to right and when all the
data values wired to a frame are available,
until the last frame executes.
8/31/15
11
Contd
Stacked Sequence Structure: It stacks each
frame so you see only one frame at a time
and executes frame 0, then frame 1,and so on
until the last frame executes.
11
Event Structure
8/31/15
11
Contd
OS initiated
timeout
Software initiated
Message from another program
Variable reaches a specific value
8/31/15
11
Formula Node
8/31/15
11
115
8/31/15
11
Strings
A string is a sequence of displayable or non-displayable
(ASCII)
characters.
Strings often are used to send commands to
instruments, to
supply information about a test (such as operator name
and
date), or to display results to the user.
Applications:
Creating simple text messages.
Passing numeric data as character strings to instruments and
converting
the strings to numeric values.
Storing numeric data to disk. To store numeric data in an ASCII
file,you
must convert numeric data to strings before writing the data to
a disk
8/31/15
11
Normal display
Password
Display
\ code
display
Hex display
8/31/15
11
String Functions
String Length
Concatenate Strings
119
String Functions
String Subset
Match Pattern
120
121
122
Formatting Strings
12
8/31/15
12
125
126
127
Formatting a Spreadsheet
Spreadsheets are popular tools for data handling
String
and analysis
There are many formats for spreadsheet data. One
of the most popular is tab-delimited:
Columns are separated by a tab character
Rows are separated by an end-of-line
character
A spreadsheet yields:
128
Creating a Spreadsheet
File
130
DAQ
Data
Acquisition
DAQ Scope
About
Overview and
Configuration
133
DAQ boards:
Analog I/O
SIGNAL
CONDITIONING:
Modify
transducer
signals
COMPUTER
withthe
SOFTWARE:
Control
the DAQ board,
Digital
PLUG-IN
DAQ
BOARD:
Measures
(acquires),
TRANSDUCERS:
Sense
measured
quantities
I/O
to match
DAQ
board
specs/ranges.
Examples:
amplification
process,
store,
and
display
data,corresponding
asinstructed
instructed
by
software
processes,
and
generates
signals,
as
stores,
and change
their properties
or generate
Counter/timer
I/O
or attenuation, filtering, excitation, etc.
program.
Examples:
LabVIEW
application
programs to acquire
by software
program.
Examples:
Analog
and digital
electrical
signals.
Examples:
strain
gage,
thermocouple,
DAQ
library
supports
all DAQ
boards
data,
simulate
instruments,
and
generate
results, etc.
signals
input
and
output,
counters,
timers,
etc.
accelerometer,
potentiometer,
etc.
LabVIEW
uses
the
NI-DAQ
driver-level
software
Data Acquisition System Components
Transducers
Sense Phenomena
Produce Electrical Signal
Examples:
Thermocouples,
Thermistors
Strain Gauges, RTDs
Pressure Transducers, Load Cells
Accellerometers, Microphones
Potentiometers, Etc..
Signal Conditioning
Condition Transducer Signals
Make Signal Suitable for DAQ
Board
Examples:
Amplification/Attenuation
Linearization/Calibration
Filtering
Multiplexing
Configurations
Hardware:
Software:
DAQ Hardware
Configuration
138
ai 0
ai 1
ai 2
Sine Wave 1
Sine Wave 2
Sine Wave 3
Tasks
139
Data Acquisition in
LabVIEW
NI-DAQmx
Next generation
driver:
VIs for performing a
task
One set of VIs for all
measurement types
Traditional NI-DAQ
Specific VIs for
performing:
Analog Input
Analog Output
Digital I/O
Counter
operations
141
NI-DAQmx Data
Acquisition
Single set of VIs used to perform
analog I/O, digital I/O, and counter
operations
142
143
Analog Input
Analog
Input task
is specific
to the
measurem
ent
144
10 V range
Resolution
10
Range
1 * 212
= 2.4. mV
1X Gain
Sampling Rate / Aliasing
Aliasing
20
1 * 212
= 4.8 mV
12 bit
resolution
Time
Adequately sampled
16-bit
ADC
146
It
Data Logging
147
Analog Output
Analog Output
task is specific
to the
generation
type
148
149
The
BASICS:
things..
LabVIEW
Application
You need 3
MAX
DAQ Device
Voltage Output
Note the ANALOG side of
the USB devices near
your computers.
There should be terminals
labeled AO0 and AO1
AO stands for Analog
Output.
Most of the NI devices
have at least 2 such
terminals
For output we wire a
terminal and a ground.
Voltage Output
Voltage Output
Counters
A counter is a digital
timing device
Typical uses of a counter:
Gate
Output
Event counting
Frequency measurement
Count Register
Period measurement
Position measurement
Source
Pulse generation
157
I/O
can read
from or write
to a line or
an entire
digital port
A digital port
is a collection
of digital
lines
158
AI Sample Channel
AO Update Channel
AI Acquire Waveform
AO Generate Waveform
DAQ Summary
Identify
Signal/Magnitude Resolution
Signal/Sampling
Resolution
Real measurements
of a simple sine-harmonic
NO
Alias.
ZERO
Aliasing
sing
a
i
l
A
DEMO Application
Sometimes
Contd..
In this case we would use a device with
the motors manual control electronics.
The controller will accept a grounded DC
signal and generates a proportional
output voltage.
This output can be supplied to the speed
setting circuit of the motors controller.
This will drive the motor at a speed
proportional to the signal that LabVIEW
sends to it.
DEMO Application
Turn-Table with experiment
Main power supplied
By 120 VAC outlet
Drive Motor
Power line
from control
8/31/15
16
8/31/15
17
8/31/15
17
Contd
It is used for analyzing and
measuring
signals from plug in data acquisition
(DAQ) devices
It can measure the frequency
components
within the signal.
FFT based measurements requires
digitization of a continues signal.
Acc to Nyquist Criteria ,the sampling
frequency Fs> 2Fm.if this criteria
violated
8/31/15
a phenomenon k/s
ALIASING.
17
Real
signal
nal
g
i
s
ed
l
p
Sam
MC
MX
CIX
*
Pro
f.
M.
Kos
tic
Real
signal
nal
g
i
s
ed
l
p
Sam
MC
MX
CIX
*
Pro
f.
M.
Kos
tic
Real
signal
na
g
i
s
ed
l
p
Sam
MC
MX
CIX
*
Pro
f.
M.
Kos
tic
Application
8/31/15
17
Power Spectrum
Calculate the harmonics power in a
signal
The power spectrum Sxx(f) of a time
domain signal x(t) is defined as
Sxx(f) =X(f)X*(f)
=|X(f)2|
X*(f)=complex conjugate
Power Spectrum is identical to the real
part
of FFT.
It calculates the harmonic power in
discrete
8/31/15
time real values sequence.
17