You are on page 1of 164

Instrumentation and Control Engineering Department

B. Tech VII sem (Batch 2019-2023)


July-Dec 2022

Virtual Instrumentation
(ICPC-404)
Course Coordinator

Dr Roop Pahuja
Associate Professor
Room No. 507 (ICE Dept.)
Contact No : 9988651877
3.3 Signal Analysis
• Signal analysis is a fundamental part of many test, measurement
and control applications.
• Analyzing a signal gives you additional insight into what your data
means—you can get a clearer picture of your desired signal or
monitor a signal for a particular behavior.
• In TD (time domain or discrete form) signal is available in discrete
form ( sampled data points as array) or as waveform data for
analysis
• Different types of signal analysis required : Time domain, freq.
domain, mixed time and frequency domain, pattern information.
• Prior to signal analysis signal processing is sometimes needed to
transform the signal, remove noise disturbances, or compensate
for environmental effects.
3.3 Signal Analysis (contd..)
• Graphical representation of discrete signal.
as Sampled data form ( X axis : no. of samples)
3.3 Signal Analysis (contd..)
• Graphical representation of discrete signal.
as Analog data form ( X axis : no. of samples)
3.3 Signal Analysis (contd..)
• Graphical representation of discrete signal.
as Analog data form ( X axis : Time)
3.3 Signal Analysis (contd..)
• Graphical representation of discete signal.
3.3 Signal Analysis (contd..)
• Graphical representation of discrete signal.
as Waveform data form ( data samples with
timing info)
• Study of typical functions (related to signal analysis : Time
Domain and frequency domain
Measurement function : Detection of some parameters
(attributes) of the signal.
(i) Mean value of DS:
(ii) RMS value of DS:
E.g 1 Calculate average and rms value of 10 samples of
randomly generated data in the range (0-100)
(iii) Cycle RMS : (signal P waveform meas)
Returns the rms value (root mean square value) of the cycle of
periodic waveform / array of waveforms
(iii) Cycle RMS
E.g 1 Make a VI that calculates RMS value of sine signal
(iv) Basic DC-RMS

Returns the averaged DC and rms value (root mean square


value) of input waveform / array of waveforms
E.g : Generate a random signal in the range 0-1. Calculate the mean
value of the signal. If the signal is acquired after the time interval of
2s, form the signal waveform and display on waveform graph.
Calculate averaged DC value and RMS value of the waveform.
E.g : Basic DC- rms
Problem (contd..)
Q.1 Make a VI that calculates the rms value of sine, sawtooth ,
square, triangular signals. The signals are available as array of
waveform. Display the rms value of each waveform on atable
with proper headers
Hint : Use function (cycle average and RMS)
for 1D array of waveform ( sine,
sawtooth, square, triangular).
generate waveforms using fn. generator by
changing signal type enum values (0,1,2,3)
Q.1
(v) Amplitude and level of waveform

Pk-pk

HL
LL

Returns the highest level, lowest level and difference between the
highest and lowest value of the signal (amp) of the input waveform
/array of waveforms
E.g. : Generate the sine waveform and cal signal peak to peak,
highest and lowest level.
E.g Amp and level of waveform
(vi) Max and min value of discrete data
Returns the max and min values of discrete samples of signal as
input array and index (es) of max and min
(vii) Extract single-tone info
Returns the amplitude and frequency of single tone input
waveform having frequency in the specified range.
The input signal should have frequency range
[min frequency, max frequency] = [2*f, (N/2 – 2)* f]
Where :
--  f = Fs/N is the frequency resolution ,
-- Fs is the sampling rate (1/t),
-- N is the number of samples in the waveform. For example, consider a waveform with a
-- t is time increment between samples sampling rate of 10 kS/s that contains
N = 1000 samples. The frequency resolution
for this waveform is 10 Hz.
The frequency of the tone you want to
measure should be in the range [20 Hz, 4.98
kHz].
E.g. Generate a std sinusoidal signal and extract single tone info
(viii) Extract Multi-tone info

Returns frequency, amplitude and phase of all freq. components


whose amplitude exceeds the threshold limit present in the input
waveform

O/p is 1D array of frequency components .


Each array element is a cluster of three elements representing
frequency, amplitude and phase of freq. comp
E.g 1 : Generate single tone sine signal and extract frequency
components
Extract Multi-tone info :
E.g. 2 : Generate mixed sine signal of different frequencies and
extract multi- tone frequency components
Problem (contd..)
Q . 2 Generate 100 samples of random input signal (0 to100). Cal the
no. of counts of the samples in the range : 0-20,20-40, 40-60, 60-
80,80-100 and display the histogram graph of the sampled data.
Also find the max. and min. value of the random signal.
(Hint : Histogram is X-Y graph : for X axis take mid-point of the
range as x data point and for Y axis corresponding number of counts
of samples as y data point.)
(ix) Multi-tone generator
Generates mixed signal based upon input signals information in terms of
different tones frequencies , amplitudes and phases taken as input array.

The function provides the waveform of mixed signal and also indicates the
individual tone frequencies in the mixed signal .
E.g : Generate a multi-tone signal of frequency 10, 20, 30 Hz. Each
signal is of zero phase and 1unit amplitude. Use default sampling
info.
(x) Total Harmonic Analyzer (THA)
Used to analyze total harmonic content in the original single tone signal
due to non-linearity in a system.

When a input signal x(t) of a particular frequency f1 ( fundamental


frequency) passes through the non-linear system ,
the signal at the output gets distorted because of additional of
different harmonic components such as f1, 2f1, 3f1 …

As the non-linearity of system increases , harmonics become more. So


the harmonic content measurement provides indication of distortion in
the signal and system non-linearity.

Generally , harmonic content in a signal is quantified by a parameter,


Total Harmonic distortion (THD) : defined as ratio of root mean square
sum of harmonics to the amplitude of fundamental frequency
. Mixed signal with fundamental and harmonic components

Distorted mixed tone


Nonlinear system
Input signal (single tine) signal
To analyze the complex time-domain signal waveform in
terms of harmonic components and calculate the THD, Total
harmonic analyzer function is used.

THA function takes a signal in (mixed tone signal) and


performs a full harmonic analysis, including measuring the
fundamental frequency tone and harmonics, and returning
the fundamental frequency, all harmonic amplitude levels,
and the total harmonic distortion (THD) value.
where :
Component level

Total harmonic distortion


Indicates the degree of harmonic distortion defined as ratio of
root mean square of harmonics to the amplitude of
fundamental frequency .
ExampleProblem
Generate a multitone signal with three sine waves of arbitrary
phase and amplitude. The frequencies are in 1:2:3 ratio. Display
the complex waveform and indicate fundamental frequency, total
harmonic content, component level of mixed signal.
Example Problem

A sinusoidal signal of frequency 5 Hz, amplitude of 1unit and zero phase is mixed with DC signal of 2 unit
amplitude and sinusoidal signal of frequency 10Hz, amplitude 1 unit and phase angle of zero degree.
Indicate the original signal and mixed signal on the same graph .
Calculate the total harmonic content in percentage and fundamental frequency in mixed waveform .
Q A sinusoidal signal of frequency 5 Hz, amplitude of 1unit and zero
phase is mixed with DC signal of 2 unit amplitude and sinusoidal signal
of frequency 10Hz, amplitude 1 unit and phase angle of zero degree.
Indicate the original signal and mixed signal on the same graph .
Calculate the total harmonic content in percentage and fundamental
frequency in mixed waveform .
Spectrum analysis ( Freq. domain analysis) Introduction……
Any TD signal can be represented in frequency domain using
Fourier’s Transform

Sampled time domain


signal DFT Freq domain analysis

X = {x[i]}
(FFT) X (f)

 To transform samples of the data (discrete signal) from the time domain into the frequency
domain, algorithm used is the discrete Fourier transform (DFT) or FFT.

 The DFT establishes the relationship between the samples of a signal in the time domain
and their representation in the frequency domain.
DFT algorithm :

States that each frequency component is the result of a dot product of the
sampled TD signal with the complex exponential at that frequency and is
given by the following equation.

𝑖=𝑁−1
2𝜋𝑖𝑘 2𝜋𝑖𝑘
𝑋 𝑘 = ෍ 𝑥 𝑖 {cos − 𝑗 𝑆𝑖𝑛 }
𝑁 𝑁
𝑖=0
 If the sampling interval is Δt seconds and the first data sample (i = 0) is at
Where 0 seconds, the ith data sample, is at iΔt seconds.
-- X[k] : Freq. domain representation  Similarly, if the frequency resolution is Δf Hz, the kth sample of the DFT
of sampled TD signal x [i], that gives mag. occurs at a frequency of kΔf Hz. However,
of frequency component k of the signal  this is valid for only up to the first half of the frequency components. The
other half represent negative frequency components
(xi) Spectral measurements (express VI)
Performs the DFT/FFT-based FD analysis of time domain signal
waveform and represents freq -mag ( spectrum graph) of the
waveform. The magnitude of each of the freq. component is
obtained in terms of peak or rms value

Input
Waveform

FFT info o/p provides cluster of three data : initial freq f0, increment
frequency f , array of computed FFT values [Y] at each frequency component with
frequency resolution of f components
Waveform graph represents the freq-magnitude ( spectral response) graph
of the signal
Where [Y] is array of computed FFT values at each freq component
Yo is FFT value at DC component ; Y1 is at f , Y2 is at 2f , Y3 = 3f ,
…….. Yk is at N/2 ( no. of samples are even) or (N-1)/2 ( no. of
samples odd)
• k = N/2 is called Nyquist freq component. , f = Fs/N
Examples Spectral measurement (e.g single tone)
Generate single -tone signal and display FFT data and show
the magnitude-freq graph of the signal
Spectral measurements (e.g. Dual-tone signal)

Generate dual-tone signal.


Show the variation of signal
with time and frequency
spectrum of the signal
Spectral measurements (e.g 2 Dual-tone)
Spectral measurements (e.g 2 Dual-tone)
Spectral measurements (e.g. signal + noise)
3.3 Signal Analysis (contd..)
(l) Spectral measurements (e.g 3 : signal + noise)
Spectral measurements (e.g low signal (1Hz) + high freq signal (50Hz))
Spectral measurements (e.g low signal (1Hz) + high freq. signal (50Hz))
Problem
Make a VI that mixes signals of 20, 50, 100 Hz freq with unit amp
and zero phase and DC signal of 2unit of magnitude with
sampling info as 2kS/s and 1000 samples. Show the complex
waveform on a graph . Also, display FFT components of the
signal and frequency spectrum of the signal. Calculate and
display the frequency increment of discrete signals in frequency
domain.
3.4 Data Acquisition
DAQ : Introduction
• Data acquisition is one of the component of real time VI system
followed by data analysis and presentation.
• Virtual instrumentation combines hardware and software with industry-
standard data acquisition and computing technologies to create user-
defined measurement/control solutions
• In VI system data acquisition hardware uses driver software compatible
with LabVIEW application software to perform real time
measurements.
• National Instruments specializes in developing PC-based general
purpose/specialized DAQ hardware and driver software compatible
with LabVIEW. : used to develop VI systems
3.4 Data Acquisition
• A general-purpose PC -basedDAQ device acquires or
generates different types of signals on multiple channels for
interfacing to real world devices or systems signals .
• It is different from other measurement systems because the
software installed on the computer performs the actual
measurements and controls the DAQ system.
• The DAQ device converts the incoming signal into a digital
signal and format the same using communication protocols
for computer interface.
3.4 Data Acquisition
• DAQ : An Introduction
Pre-processed Anti-aliasing filter
signals
Analog
/digital With S/H
On multiple
channels
Communication interface

PC comm port

To PC
Driver layer and application software to extract and analyze
data and control DAQ device
3.4 Data Acquisition
Signal types for DAQ
3.4 Data Acquisition
• DAQ Classification : Depends upon …
(i) General purpose or Specialized
(signal measurement : analog/digital
sound/ vibration, motion controller, image
acq.
(ii) Local or distributed (network- based)
Plug-in type
internal bus of a computer through a plug-
in slot.
Portable ( serial, USB, parallel port)
External PC ports.
3.4 Data Acquisition

• DAQ : An Introduction
• DAQ Classification : Depends upon …
(iii) NI DAQ devices or third party DAQ devices
(driver software compatible with LabVIEW)
3.4 Data Acquisition
• Use of General –Purpose NI-DAQ
Salient features/specification
--- Multifunctional : input and output .
----- Plug-in/ portable
--- Suited for general purpose signals,
Classified depending the way it conveys info
Analog : DC, TD, FD
Digital : ON/OFF (TTL levels), Pulse train
----- No. of channels ( AI, AO, DI, DO) channels
------ Signal modes for analog : Differential and single
ended channels
3.4 Data Acquisition
• Use of General –Purpose DAQ
• Salient features/specification
---- Signal ranges : ±10V; Multiple ranges (± 1V, ± 5V)
----- Sampling rate : max sampling rate for the device
e.g.. 200kS/s
sampling rate per CH = Max sampling rate /no.
of used CH
max freq. of input signal = Max sampling rate/2.N
----- Resolution of ADC : no. of bits of ADC
10bit, 12 bit, 16 bit
3.4 Data Acquisition
• Use of General –Purpose DAQ
• Salient features/specification
---- Code width : Min level of the signal measured

---- CH selector type : Screw terminal, BNC connector


---- Pin layout : Diagram specifying signals names
and CH with respect to pin no. on the channel selector:
physical Ch to connect signals
E.g :-- NI-PCI 6221, NI-USB 6015, NI-USB 6009
• Relationship between signal range, PGA, ADC ref

Vin_range x G = Vref for ADC (best match)


Vin (res in V) = Vref/(G. 2n )
Note : to get the best resolution of the DAQ device to digitize the unknown
voltage signal, signal range should match the ADC ref voltage
Given a DAQ device :
Vref for ADC is fixed = 5V (unipolar or bipolar)
For analog input signal measurement , Vin range is selected by the user during
configuration of DAQ so that unknown signal is within the range selected.
Then driver software sets value of G for PGA so that the selectable signal range
should best match the range of the input signal
Vin_range x G = Vref for ADC (best match)
The resolution with which the unknown signal voltage is digitized is given by Vin
(res in V) = Vref/(G. 2n )
Q. 1 A typical DAQ uses 10bit ADC with ref of ±5V with
bipolar/unipolar selection. The PGA has gain setting of 0,5, 1, 2,
5,10.
The DAQ software provides the user with selectable unipolar and
bipolar signal ranges of 0-10V, 0 to 5V, 0 to 2V, -5 to 5V.
If the system is used to measure the signal that varies in the range
0 to 2 V, find the appropriate selectable signal range and gain
setting of PGA. Also find the code width of the signal.

Ans : Input signal range = 0-2V


User selectable signal range for DAQ = 0-2V ( best match)

Automatic PGA gain setting G = Vref/ signal range = 2.5


selected gain setting = 2 (best match)

Code width = Vref / G 210 = 5 / 2 x 2 10 = 0.0024 V


Q.2 A typical NI DAQ system uses PGA with gain setting of 0.5,1,10,
100 and 10-bit ADC with ref voltage of ± 5V. Suggest the
available signal
ranges specified by DAQ. Also find the resolution with which signal
is digitized if Vref is 5V, G=10

Signal ranges = ADC ref/G setting

Available signal ranges on DAQ ± 10V, ± 5V, ± 0.5V, ± 0.5V


DAQ In LabVIEW
Hardware

NI DAQ Devices Third party devices


General –Purpose General –Purpose
Specialized Specialized
( Local/portable/network based/ wireless connectivity/embedded hardware )

Driver software ( available in function palette) Requirement of LabVIEW


MAX : utility software available compatible Driver software
LabVIEW compatible and programmable Driver software interacts with
VISA (Virtual Instrument Software
Architecture) functions

VISA is Standardized software interface to communicate with DAQ hardware using any communication
protocol.
Data Acquisition

Flow model for PC –based data acquisition/measurement
in LabVIEW

Shows the path of measurement of real-world physical


phenomena through DAQ to LabVIEW measurement
application

Use of NI DAQ hardware + driver software + MAX (utility


software) + LabVIEW application software to
acquire/generate data in LabVIEW to interact with real
world phenomenon.
Steps for data acquisition in LabVIEW
using NI DAQ hardware
• Use a suitable DAQ and connect to PC USB port
• Go to MAX for detection and testing of Device
• In MAX device is detected under Devices and interfaces.
See Pin out of the device , Rgt. click on detected device , Go
To  Pinouts
• Interface sensor and actuators to suitable CHs of DAQ
• Make VI program for data acq. of signals using DAQ
Assistant by configuring the channels used.
• Process the signals , write control algo and initiating CS (
analog /digital to port CHs of DAQ)
• Make a VI program for display of data on UI
What is MAX ( Meas and Automation Explorer)

• Utility software to test DAQ devices


Provides access to your National Instruments hardware
devices including DAQ
Helps to detect the devices and instruments connected to
your system.
Helps to execute system diagnostics and run test panels.
Provides the pin details of the DAQ channel selector to
connect signals .
3.4 Data Acquisition
Steps to Use MAX : TO detect and test DAQ
• Connect NI-DAQ to PC.
• Open MAX ( LabVIEW  Tools  MAX)
• Check detection of DAQ in MAX : If the device is connected
to PC and is detected by MAX it is indicated under DAQmx
devices
MAX My system  Devices -> DAQmx
Devices -> DAQ 6015
• To test CH : Go to ‘Test panel’ tab and test the signals
connected to CH
• To see pin outs : Rgt. click on DAQ  pin outs
Red cross :
device no
detected
USB icon with device name
: device detected
DATA ACQUISITION IN LabVIEW
using
General purpose NI DAQ devices
(NI 6015 (USB); NI 6009 (USB); NI 6221 (PCI))
and DAQ Assistant in DAQmx software
DAQ 6015
Important specifications
 Analog CHs : 16 SE ( signal line +S and Agnd),
 8 differential ( + S, -S, Agnd)
 Analog output : 2 CHs
 Digital I/O ports : 2 ports , 16 lines ( I/P or O/P).
 Max signal range =  10V, (other selectable ranges) 0-10,  0-5V,
0-5V, 0-1V,
 PGA with different gain settings (0.5 , 1, 2, 5, 10 ), unipolar /bipolar
 ADC Vref =  5V,
 Sampling rate = 200KS/s
 Multifunctional USB based
• DAQ (6015)
• Pin configuration of typical DAQ (6015) ( Use MAX)
Using MAX : TO detect and test DAQ
• Pin configuration table represents pin no. and associated
signal name representing signal type and CH no.

Signal Pin No. Description


name
AI 0 1 Analog input signal at
AI 1 4 CH0 to15 and gnd
…. … Single ended connection
AI 15 27 uses : Ch and gnd
AI GND 3,6,9… Diff uses : + ch and-ch
Signal name Pin No. Description

•AO 0 15 Analog output signal at


AO 1 31 CH0 and1 and asso. Gnd
AO GND 16, 32

P0.0 33 Digital signal port 0 line 0


…. …. ….
P0.7 42 Digital signal port 0 line 7
(digital lines used as i/p
or o/p)
D.gnd 35,39, 43 Digital gnd
NI 6009
• USB based : Portable
• Simple device
• Sampling rate : 48kS/s
• AI : 8 SE, 4 Diff Ch
• AO: 02 Chs
• D I/O : Port 1 : Lines 0 to 7
• Compatible with LabVIEW 15 or higher,
• Windows 10
• DAQMx driver 7.0 or higher
DAQ using NI 6009 card

When the NI DAQ card is connected on PC


Use of MAC to detect and test DAQ , see pinouts
Use of Data acquisition driver layer functions to program DAQ
code

(a) DAQ Assistant (express VI) (To be configured)


Fn. Palette  Meas I/O  DAQmx  DAQ Assistant

Allows to configure a particular channel/s and select associated


parameters to read or write data on Analog or Digital Ch or channels
Common parameter selected are :
DAQ device no., DAQ mode ( acquire or generate), signal type (
analog or digital), CH no. ( one or add multiple channels) , voltage range
, timing parameters.
Fn. Palette  Meas I/O  DAQmx  DAQ Assistant
3.4 Data Acquisition
(a) DAQ Assistant (express VI).

2 Modes

Configured to acquire signals Configured to generate signal,


Read data write data
AI, DI AO, DO
Configuration of DAQ Assistant to data
acquisition/generation in LabVIEW
Configuration of DAQ Assistant : Analog input
After configuring all parameters of DAQ >> CLICK OK
(b) Convert from dynamic data.
( express VI signal manipulation  from DDT)

Converts the dynamic data to


numeric or Boolean scalar/array data types
for use with other VIs
(b) Convert to dynamic data.
( express VI signal manipulation  To DDT)

Converts the numeric , Boolean data to


dynamic data types for use with express VI
for data acquisition DAQ
DAQ VI program : Reading and writing signal to
different CH of DAQ
(a) Make a VI program that continuously read
analog voltage from AI0 CH of DAQ (6015)
(i) Physical connecting signal to designated CH

V Power
supply
+ -
(ii) To make a VI : Place DAQ Assistant on BD and configure
it
 Select Device : Daq 6015 (dev1)
 Select acq mode : Acquire or generation
signal type : Analog input, voltage
 Select Ch no. : AI 0
Terminal Conf: Differential (only mode available)
 Voltage range : ± 10V
 Select sample mode : Sample on demand
Click OK….. Wait …… DAQ Ass builds…. Data
Terminal is available
(iii) Complete VI program with while loop, voltage
indicator and a waveform chart
3.4 Data Acquisition
(iV) Run program and read voltage value as acquired from
the designated CH on panel
3.4 Data Acquisition
(iv) Actual physical system displaying value
Reading Analog voltage using NI DAQ 6009 , AI2 ( RSE)
3.4 Data Acquisition
DAQ VI program : Reading and writing signal to
different CH of DAQ
(b) Make a VI program that writes analog
voltage (0 to10)connected to AO0 CH of DAQ
(i) Physical connecting signal to designated CH

Voltage
Indicating
meter
- +
3.4 Data Acquisition
(ii) To make a VI : Place DAQ Assistant on BD and configure
it
 Select Device : DAQ 6015 (dev1)
 Select signal type : Analog output
 Select Ch no. : A0 0
 Voltage range : 0 to 10V
 Select sample mode : Sample on demand
Click OK….. Wait …… DAQ Ass builds…. Data
Terminal is available
3.4 Data Acquisition
(iii) Complete VI program :
Generate analog output voltage at output
Q. Make a VI program to generate random voltage in
the range 0-10V at output channel AO0 after 5s of time
interval until STOP button is pressed.
3.4 Data Acquisition
DAQ VI program : Reading and writing signal to
different CH of DAQ
(c) Make a VI program that writes digital signal (T/F) to
ON/OFF LED connected to digital line P0.0
(i) Physical connecting signal to designated CH

+ 250ohm

LED is connected to PO0 digital line


3.4 Data Acquisition
(ii) To make a VI : Place DAQ Assistant on BD and configure
it
 Select Device : Daq 6015 (dev1)
 Select signal type : Digital
Select Line no. : P0.0
 Mode : Output
 Invert : no (check box not clicked)
 Select sample mode : Sample on demand
Click OK….. Wait …… DAQ Ass builds…. Data
Terminal is available
3.4 Data Acquisition
Use On/OFF switch to write Boolean data to o/p digital line
connected to LED.
Convert Boolean data to array to data terminal input
of DAQ ASSisstant
3.4 Data Acquisition
(iii) Complete VI program . Use On/OFF switch to write
Boolean data to o/p digital line. Feed array to Boolean array
to data terminal input.
3.4 Data Acquisition
(iii) Complete VI program . Use On/OFF switch to write
Boolean data to o/p digital line. Feed array to Boolean array
to data terminal input.
3.4 Data Acquisition
DAQ VI program : Reading and writing signal to
different CH of DAQ
(d) Make a VI program that reads digital signal (T/F)
connected to digital line P0.1
(i) Digital input signal to designated CH

Mechanical switch

5V

Digital signal input to P0.1


3.4 Data Acquisition
(ii)To make a VI : Place DAQ Assistant on BD and configure it
 Select Device : Daq 6015 (dev1)
 Select signal type : Digital
Select Line no. : P0.1
 Mode : INPUT
 Invert : no (check box not clicked)
 Select sample mode : Sample on demand
Click OK….. Wait …… DAQ Ass builds…. Data
Terminal is available
3.4 Data Acquisition
Read the status of the switch connected to DAQ PO.1
When switch is OPEN (OFF state)

When switch is closed


Index array
Make a VI program that reads multiple analog inputs from
different channels.
 Use ADD CH to configure DAQ for acquisition of signals on
multiple channels .
 Configure DAQ for one CH and then ADD channels with same
configuration parameters

Place DAQ Assistant on BD and configure it for one analog input channel
 Select Device : Daq 6015 (dev1)
Mode : Acquisition
 Select signal type : Analog input, voltage
 Select Ch no. : AI 0
Terminal Conf: RSE
 Voltage range : ± 10V
 Select sample mode : Sample on demand
Click OK….. Wait …… DAQ Ass builds…. Data
Terminal is available

Then go to < ADD channel> tab and configure it , click OK


Use AI0 ( Pin 2, Pin3) and AI2 Chs ( Pin 7, Pin9) configured as RSE

+
V1

+
V2

I/P voltage Circuit diagram showing interfacing of Multiple analog input


signals to DAQ
sources
Array of Dynamic
data containing
voltage samples of
two channels
indexed in
sequence of
channels configured

Convert dynamic
data
to array
DAQ program with mixed- multiple signals :
Eg. Read Analog, Read Digital signal , write analog, write digital

• To read mixed signals from DAQ, Use DAQ Assistant for each signal type .
ADD Chs if multiple signals of same signal type are required.
• Place DAQ Assistant in sequence structure to read different type of
signals from channels of DAQ simultaneously.
[Note : If the operation is not providing sequencing n in the use of DAQ
Assistant then use of Sequence structure is a must otherwise it is
optional]
• In as sequence structure there are different frames and code executes in
a sequential manner.
• The output from each frame is available to other frames or outside the
frame.
• Each frame has a DAQ Assistant configured to read/write analog/ digital
signal and data from one frame flows to another depending upon the
program code.
• Sequence structure
Example Program : Mixed signals Acquisition

Make a VI program that reads SE analog voltage signal from


channel AI3 of DAQ. If the signal value exceeds the alarm limit of
6V, LED alarm connected to DAQ channel P0.1 is activated. Show
the physical connection diagram and DAQ configuration

Note : This program can be done with sequence structure and


without sequence structure also.

Analog Read Digital write


• DAQ Assistant : when DAQ Assistant are accessed simultaneously
without sequencing then error indicating use of DAQ hardware is
generated
• Recommended to use SEQUENCE structure to read /write data to
DAQ or use ADD CH while configuring same CHs
Case Study ( Development of VI system for real-time app)

• --------------------
Steps followed to study and implement a case study.
 Knowledge of process
 Types of signals
 Sensor selection and characterization data
 Actuator selection
 DAQ selection
 Requirement of the project
 What functions to be specified
 Make System block diag : Hardware and Software
 Make Interfacing and circuit diagram ( circuit design)
 Flow chart of virtual instrument program
 Design of typical algorithm used for signal processing, analysis, control , predict etc.
 Optionally simulate the algorithm for testing the same
 physically connect all hardware devices and signals with PC
 Make a VI program with all functions and features and attractive user interface
Taking care that system can be expanded easily
 Test the developed VI system real-time performance
 Improve on system performance if required or add new functions.
Design layout of VI : Main VI , subVI
Optionally simulating the functionality of VI program ( what
the system will overall do)
Implementing the program for real time application each
program steps, testing and proceeding
Full program for real tie application is complete
 Final testing and validating program results
Logically designing the front panel as professional GUI /MMI
Building exe file.
Allow the user to use the VI system
Taking feedback from user for further improvement
Bringing the next version with improved features.
Program:
Interface analog input signal from power supply to analog input CH 0 of NI 6009 card
and make a VI program to graphical display the voltage on chart until STOP button is
pressed. Also compare the input value with threshold limit and generate an alarm.
Set data acquisition rate of 1s
• CASE Study : PC based VI system for
Temperature Monitoring and
Logging
Problem
Make a VI program to continuously monitor room temperature until
STOP button is pressed using LM35 smart temperature transducer
Display the temperature variations on chart and log the readings

System hardware/software : standard PC, DAQ NI 6015


LM35 IC temperature sensor (10mV/°C, -40 to 120°C) ,
LabVIEW 2015 or higher PDS
Connection diagram
Excitation signal of 5V is given to sensor from external PS unit
Output voltage of sensor is interfaced to DAQ ch AI0 (selected as diff)
Alog :
Use while loop with STOP button
Set Time increment = 1s
Configure DAQ assiatnt with foll parameters
……………………..
…………………,,,,,
………………….
At iteration i = 0
Read analog voltage at AI0 from DAQ Assistant
Convert dynamic voltage to scalar voltage using FROM DDT function
Convert voltage sample (V) to temperature sample (C) using
Ti = Vi X 100
Display temperature on indicator
Link temperature to chart for graphic display
If STOP= T
Abort VI
otherwise i= i+1
Repeat Process and continuously show data on front panel.
Place DAQ assistant and configure
Program to monitor temperature using LM35 sensor
Conversion of sensor voltage to engineering unit in C
Vs = 10mV/C x T ( static transfer function of the sensor)
T = Vs x1000 mV / 10 C
Or T = Vs /0.01 C or Vs X 100 C

Sensor voltage at Ch AIO

Inverse sensitivity value in V/C)


Temperature in
deg C

Time in s
Set up to measure ambient temp of LAB using LM35 sensor and vary temp by heating the
sensor

Physical Interface of LM 35 sensor with DAQ .


Another program --Extending temperature monitoring program with data logging

Notepad file
Another Program : Continuous acquisition of temperature array data and averaging
to minimize random noise
Problem :
Make a VI program to continuously monitor temperature of a room
using LM35 sensor after 1s of time interval until STOP button is
pressed. Use DAQ 6015, provide 5V excitation signal to sensor from
DAQ channel AO0.
Display temperature variation on a chart and log relative time -temp
data in a file. Also compare temp value with high and low alarm
status and display low and high alarm status.

Procedure:
 Do physical interfacing : Provide excitation of 5V to sensor from
DAQ AO0 and connect sensor output to analog input channel AI2
 Make VI program
 Use three frame sequence structure VI :
Seq structure : Frame 1 : Configure DAQ Asst. to write analog
voltage value of 5V to AO0
Seq structure : Frame 2 : Use wait fn with 20ms wait time to
stabilize excitation signal for sensor to take reading.
• Seq structure : Frame 3 : Configure DAQ Asst. to read sensor
voltage signal at ch AI0
 Convert sensor voltage to Temp in C using S value of 10mV/C.
 Display temp
 log time-temp data in file,
 Analyse temp value for to activate alarms .
 Display alarms
For continuous monitoring use outer while loop with time interval of 1s
and Stop button
Excitation signal of 5V is given to sensor from DAQ AO0
Output voltage of sensor is interfaced to DAQ ch AI0 (selected as diff)

AI0
AI0
AI8
Agnd

+5 V AO0
AO gnd
Gnd
DAQ 6015
Time -Temp logging in file
To develop temperature ON-OFF Controller

Monitoring and controlling Temp using ON/OFF controller with dead


band

Sensor : LM35, S=10mV/C


DAQ Card : NI 6015
• Dead band controller algo

If Ti > TSLH
Heater (Hi)  ON ( T)
Else If Ti < TSLL
Heater (Hi)  OFF ( F)
Otherwise Hi = Hi-1
Where Ti presents value of temperature at current ith iteration
Hi presents status of heater at current ith iteration
Hi-1 presents status of heater at i-1 iteration

You might also like