This document discusses a webinar on demystifying data acquisition and accessing data through LabVIEW, MATLAB, and Simulink. The webinar covers basics of data acquisition systems including sampling rate, aliasing, resolution, range, and normalization. It also discusses various hardware options for data acquisition and interfacing data acquisition devices with software platforms like MATLAB, Simulink, and LabVIEW.
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Webinar on Demystifying Data Acquistion Systems: Access Data through Matlab, Simulink & LabVIEW
1. Webinar onWebinar onWebinar onWebinar on
Demystifying Data Acquisition:Demystifying Data Acquisition:Demystifying Data Acquisition:Demystifying Data Acquisition:
Access Data Through LabVIEW, MATLAB and SimulinkAccess Data Through LabVIEW, MATLAB and SimulinkAccess Data Through LabVIEW, MATLAB and SimulinkAccess Data Through LabVIEW, MATLAB and Simulink
DrDrDrDr.... S. MEENATCHI SUNDARAMS. MEENATCHI SUNDARAMS. MEENATCHI SUNDARAMS. MEENATCHI SUNDARAM
Associate Professor (Senior Scale)
Department of Instrumentation & Control Engineering
Manipal Institute of Technology, Manipal
meena.sundar@manipal.edu
Organized by
Department of Electronics & Instrumentation,
HindusthanHindusthanHindusthanHindusthan College of Engineering andCollege of Engineering andCollege of Engineering andCollege of Engineering and Technology,Technology,Technology,Technology, CoimbatoreCoimbatoreCoimbatoreCoimbatore
The pdf version of this presentation is available at https://www.slideshare.net/meenasundar/
2. Agenda:
1
Basics of Data Acquisition
Systems
• Introduction & Block Diagram
• Sampling Rate
• Aliasing & Sampling Theorem
• Throughput
• Logical Levels
• Resolution
• Range
• Mode
• Normalization
• Case Study
How can we do Data
Acquisition
• DAQ Devices / Hardware
• Matlab Toolbox
• NI USB to Matlab
• Arduino to Matlab
• ACE 2002 to Matlab
• ACE 2002 to Simulink
• ACE 2002 to LabVIEW
• Modbus Devices
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
4. Introduction & Block Diagram
3
• What is a Data Acquisition System?
– A system or a device which acts as a link / mediator
between external world variables to personal computers.
– interface between the signal and a PC
– abbreviated as DAS or DAQ
– typically convert analog signals into digital values for
processing and digital values to analog signals for
controlling
– Definition by Wikipedia:
• The process of sampling signals that measure real world physical
conditions and converting the resulting samples into digital numeric
values that can be manipulated by a computer.
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
5. Introduction & Block Diagram
4
Temperature Flow
Pressure
Speed
Level
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
6. Introduction & Block Diagram
5
• Prerequisite:
1. Understand your process
− Process Variables
− Range of measurement
− Frequency of signal variation
2. Select suitable sensor
− Direct / Indirect measurement
− Accuracy
− Resolution
− Output Standards & Range
− Calibration
− Cost / Budget
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
7. Introduction & Block Diagram
6
Temperature
Range: 0 – 1200 °C
Step 1: Understand
the Process
Step 2: Select your
sensor
Thermocouple
0 °C – 0mV
1200 °C – 48.838mV
Step 3: Design a Signal
Conditioning Circuit
Something Difficult
Transmitters
Standard Outputs
• Voltage 0 to 5V, 0 to 10V, -10 to +10V, -5 to +5V
• Current 4 to 20mA, 0 to 20mA
Beginning Point
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
8. Introduction & Block Diagram
7
• DAQ has two sides:
– Signal side
– Personal Computer / Processor side
• Signal Side:
– Physical Variable
− Sensed by a Sensor
– Altered by a Signal Conditioning Circuit (SCC)
• Processor Side:
– Communication Medium
− Protocols / Driver Software
– Software Platform
Standard
Signal
Format
Sensor /
Transmitter
Physical
Variable
DAQ
System
Software
Platform
Protocols /
Standards
Communication
Medium PC
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
9. Introduction & Block Diagram
8Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
10. 9
Introduction & Block Diagram
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
11. 10
Introduction & Block Diagram
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
12. Sampling Rate
11
Analog
Input
4 Samples/cycle
8 Samples/cycle
16 Samples/cycle
The higher the sampling rate, the better
Not obviously true
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
13. Aliasing & Sampling Theorem
12
• Acquired signal gets distorted if sampling rate is too
small.
• The highest frequency (The so-called Nyquist
frequency) which can be accurately represented is one-
half of the sampling rate.
• A continuous time signal can be represented in its
samples and can be recovered back when sampling
frequency fs is greater than or equal to the twice the
highest frequency component of message signal.
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
14. Throughput
13
• Effective rate of each individual channel is inversely
proportional to the number of channels sampled.
• Example:
– 100 KHz maximum.
– 16 channels.
100 KHz/16 = 6.25 KHz per channel
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
15. Resolution
14
• Number of bits the ADC uses to represent a
signal
• Resolution determines how many different
voltage changes can be measured
• Example: 12-bit resolution
No. of levels = 2No. of levels = 2No. of levels = 2No. of levels = 2resolutionresolutionresolutionresolution = 2= 2= 2= 212121212 = 4,096= 4,096= 4,096= 4,096 levelslevelslevelslevels
• Larger resolution = more precise representation
of your signal
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
16. Resolution
15
– 3-bit resolution can represent 8 voltage levels
– 16-bit resolution can represent 65,536 voltage levels
100 200150500
Time (µµµµs)
0
1.25
5.00
2.50
3.75
6.25
7.50
8.75
10.00
Amplitude
(volts)
16-Bit Versus 3-Bit Resolution
(5kHz Sine Wave)
16-bit resolution
3-bit resolution
000
001
010
011
100
101
110
111
| ||||
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
17. Resolution
16
• Resolution = Amplitude / No. of Levels
• 3 Bit ADC with input amplitude of 10V can yield a
resolution of
10V / 8 = 1.25V
• 16 Bit ADC with input amplitude of 10V can yield a
resolution of
10V / 65536 = 152 μV
• 12 Bit ADC with input amplitude of 10V can yield a
resolution of
10V / 4096 = 2.44 mV
More than sufficient for process control applications
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
18. Range
17
• Minimum and maximum voltages the ADC can digitize
DAQ devices often have different available ranges
– 0 to + 5 volts
– -5 to +5 Volts
– 0 to +10 volts
– -10 to +10 volts
• Pick a range that your signal fits in
• Smaller range = more precise representation of your
signal
• Allows you to use all of your available resolution
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
19. Range
18
Range
100 200150500
Time (µµµµs)
0
1.25
5.00
2.50
3.75
6.25
7.50
8.75
10.00
Amplitude
(volts)
Range = 0 to +10 volts
(5kHz Sine Wave)
3-bit resolution
000
001
010
011
100
101
110
111
| ||||
•Proper Range
– Using all 8
levels to
represent your
signal
•Improper Range
– Only using 4
levels to
represent your
signal
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
100 20015050
Time (µµµµs)
0
-7.50
-10.00
-5.00
-2.50
2.50
5.00
7.50
10.00
Amplitude
(volts)
Range = -10 to +10 volts
(5kHz Sine Wave)
3-bit resolution
000
001
010
011
100
101
110
111
| ||||
20. Logic Level
19
• “Acceptable” input signal voltages - 0 to 0.8
volts for a “low” logic state, and 2 volts to 5 volts
for a “high” logic state.
• “Acceptable” output signal voltages range from 0
volts to 0.5 volts for a “low” logic state, and 2.7
volts to 5 volts for a “high” logic state.
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
21. Logic Level
20Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
22. Mode - Differential, RSE or NRSE
21
• Differential Mode
– Two channels used for each signal
– ACH 0 is paired with ACH 8, ACH 1 is paired with ACH 9,
etc.
– Rejects common-mode voltage and common-mode noise
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
23. Mode - Differential, RSE or NRSE
22
• Referenced Single Ended (RSE) Mode
– Measurement made with respect to system ground
– One channel used for each signal
– Doesn’t reject common mode voltage
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
24. Mode - Differential, RSE or NRSE
23
• Non-Referenced Single Ended (NRSE) Mode
– Variation on RSE
– One channel used for each signal
– Measurement made with respect to AISENSE not system
ground
– AISENSE is floating
– Doesn’t reject common mode voltage
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
25. Normalization
24
• Min-max normalization: to [new_minA, new_maxA]
• Ex. Let temperature range of 30 to 300 °C is
normalized to [0, 100%]. Then 160 °C is mapped to
min
' ( _ max _ min ) _ min
max min
A
A A A
A A
v
v new new new
−
= − +
−
160 30
(100 0) 0 48.148%
300 30
−
− + =
−
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
26. Case Study
25
• Consider a level tank with a height of 0.5 m. A level
transmitter is used and calibrated to give an output of 1
to 5V for 0 to 0.5m of level. A data acquisition card
with a resolution of 12bit is used with a input range of
0 to 5V. If the level value is 0.3m, calculate the binary
value that will be stored in the memory of the system.
Solution:
0 to 0.5m → 1 to 5 V
• 0.3m →
0.3 0
(5 1) 1 3.4
0.5 0
V
−
− + =
−
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
27. Case Study
26
• ADC
– 0V → 0 0 0 0 0 0 0 0 0 0 0 0 → 0 (Decimal Value)
– 5V → 1 1 1 1 1 1 1 1 1 1 1 1 → 4095
• 3.4V →
• 2785 → 1 0 1 0 1 1 1 0 0 0 0 1
3.4 0
(4095 0) 0 2784.6 2785
5 0
−
− + = ≈
−
Level
Transmitter
0 – 0.5 m ADC
(12 Bit)
1 – 5 V PC /
Memory
0000 0000 0000
1111 1111 1111
0.3 m 3.4 V 1010 1110 0001
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
28. Few more things to Think
27
1. Consider a Pressure control system with a tank capacity of 0 to
2 Kg/m2. A pressure transmitter is used and calibrated to give an
output of 4 to 20 mA. A data acquisition card with a resolution
of 10 bit is used with a input range of 0 to 20mA. If the pressure
value is 0.6 Kg/m2, calculate the binary value that will be stored
in the memory of the system.
2. In the above question, find out what is the input pressure
change and transmitter change, if there is a 1bit change in the
memory (minimum detectable pressure).
3. If the fastest varying signal in a frequency spectrum is 2kHz.
What is the sampling period?
4. Consider a transmitter with an output range of 0 – 5V. The
minimum detectable voltage is 1mV. Calculate the resolution of
ADC needed to achieve this.
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
29. PART 2
How can we do Data Acquisition
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 28
30. DAQ Devices / Hardware
• A DAQ device (Data Acquisition Hardware) usually has these
functions:
• Analog input
• Analog output
• Digital I/O
• Counter/timers
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 29
31. DAQ Devices / Hardware
We have different DAQ devices, such as:
• Desktop DAQ devices
o where you need to plug a PCI DAQ board into your
computer. The software and hardware both running
on a computer.
• Portable DAQ devices
o for connection to the USB port, Wi-Fi connections,
etc. The software is running on a computer.
• Distributed DAQ devices
o where the software is developed on your computer
and then later downloaded to the distributed DAQ
device.
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 30
32. DAQ Devices / Hardware
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 31
33. DAQ Devices / Hardware
Data Acquisition with PCI
SCXI-1503
USB Data Acquisition
Wireless Data Acquisition
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 32
34. DAQ Devices / Hardware
USB, Ethernet, and 802.11 Wi-Fi
connectivity
Ethernet Data Acquisition
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 33
35. DAQ Devices / Hardware
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 34
36. DAQ Devices / Hardware
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 35
37. Driver Software
• Driver software is the layer of software for easily
communicating with the hardware.
• It forms the middle layer between the application
software and the hardware.
• Driver software also prevents a programmer from
having to do register-level programming or
complicated commands in order to access the hardware
functions.
• Driver software
• National Instruments: NI-DAQmx
• Serial Communication: CH340SER or CH341SER
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 36
38. Application Software
• Application software adds analysis and presentation
capabilities to the driver software.
• Your software application normally does such tasks as:
o Real-time monitoring
o Data analysis
o Data logging
o Control algorithms
o Human machine interface (HMI)
• In order to create your DAQ application you need a
programming development tool, such as Visual
Studio/C#, LabVIEW, Matlab, etc..
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 37
40. Communicating with Serial Port
1111.... CreateCreateCreateCreate anananan instrumentinstrumentinstrumentinstrument objectobjectobjectobject — Create the serial port
object ‘s’ associated with the COM1 serial port.
s = serial('COM1');
2222.... ConfigureConfigureConfigureConfigure propertypropertypropertyproperty valuesvaluesvaluesvalues — Configure s to match the
instrument's baud rate and terminator.
set(s,'BaudRate',4800);
set(s,'Terminator','CR');
3333.... ConnectConnectConnectConnect totototo thethethethe instrumentinstrumentinstrumentinstrument — Connect ‘s’ to the
instrument. This step occurs after property values are
configured because serial port instruments can transfer
data immediately after the connection is established.
fopen(s);
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 39
41. Communicating with Serial Port
4444.... WriteWriteWriteWrite andandandand readreadreadread datadatadatadata — to Write and read
fread(s,’Data*’);
fwrite(s,’Data*’);
5555.... DisconnectDisconnectDisconnectDisconnect andandandand cleancleancleanclean upupupup — When you no longer need s,
you should disconnect it from the instrument, remove it
from memory, and remove it from the MATLAB
workspace.
fclose(s)
delete(s)
clear s
Note: USB Communication is also a serial communication
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 40
42. Communicating with Serial Port
S=serial('COM1','DataBits',8,'StopBits',
1,'Parity','None','BaudRate',9600,'Input
BufferSize',5000,'Timeout',0.15);
TCP Object:
S=tcpip(adr, port); %IP and Port
set(S, 'InputBufferSize', 512);
S.ByteOrder='bigEndian';
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 41
44. Test & Measurement Tool
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 43
45. Standard DAQs Vs Custom DAQs
44
• According to analysts at Technavio, the global
industrial data acquisition system market is expected to
reach $1.28 billion in 2020.
• Standard DAQ Manufactures
– National Instruments
– Yokogawa
– MCCDAQ
– Advantech
– Omega, etc…
Issues:
Supplied with manufacturer application software.
Not compatible to research software like Matlab / Simulink / LabVIEW
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
46. Standard DAQs Vs Custom DAQs
45
• What is a Custom DAQ?
– There is nothing like custom DAQ
• But…..
– You can use these…..
Arduino
Node MCU 8266
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
47. Hardware Support Package for Matlab
46Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
48. NI USB 6002 with Matlab
clear all;clc;
s = daq.createSession('ni');
addAnalogInputChannel(s,'Dev1', 0:3, 'Voltage');
addAnalogOutputChannel(s,'Dev1', 0:1, 'Voltage');
outputSingleScan(s,[-2 2]);
inputSingleScan(s);
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 47
49. NI USB 6002 with Matlab - Demo
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 48
50. Arduino with Matlab
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 49
51. Arduino with Matlab
% Sample Code 1
clear all;clc;
a = arduino('com4','uno');
delay=1
for i=1:10
writeDigitalPin(a,'D12',1)
pause(delay);
writeDigitalPin(a,'D12',0)
pause(delay);
end
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 50
% Sample Code 2
clear all;clc;
a = arduino('com4','uno');
for i=1:10
clc
writePWMVoltage(a,'D11',i*0.5)
Outputvoltage=i*0.5
pause(10);
end
% Sample Code 3
clear all;clc;
a = arduino('com4','uno');
for i=1:10
clc
writePWMVoltage(a,'D11',i*0.5)
Outputvoltage=i*0.5
pause(2);
Inputvoltage=readVoltage(a,'A1')
pause(8);
end
52. Arduino with Matlab - Demo
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 51
53. Arduino with Matlab - Demo
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 52
54. Arduino with Matlab - Demo
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 53
55. ACE 2000 Series Products
ACE 2001 Voltage Module 8AI / 2AO
ACE 2002 Current Module 4AI / 2AO
ACE 2003 Dual Loop PID Controller (Voltage Module)
ACE 2004 Dual Loop PID Controller (Current Module)
ACE 2005 Voltage (8AI / 2AO) / Current (4AI / 2AO) Module
ACE 2006 Wireless Voltage Module 6AI / 2 DI / 2AO
ACE 2007 Wireless Current Module 4AI / 2AO
ACE 2008 Wireless Dual Loop PID Controller (Voltage Module)
ACE 2009 Wireless Dual Loop PID Controller (Current Module)
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 54
56. ACE 2000 Series Products
Sample Code:
S=Comport('com3');
for i=1:10
% a=Idaqrw(S,Op0,Op1,t)
a=Idaqrw(S,7.2,18.9,0.5)
End
Closedaq(S);
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 55
57. ACE 2000 Series Products
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 56
58. ACE 2000 Series Products
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 57
59. ACE 2000 Series Products
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 58
60. One Step Ahead
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink 59
Modbus Devices:
1. Single Loop PID Controllers
2. Dual Loop PID Controllers
3. PLCs with Modbus support
4. Devices with OPC server access
61. Useful Links
60
• https://lms.matlabhelper.com/blog/install-hardware-
support-packages/
• https://www.coursera.org/lecture/mobile-health-
monitoring-systems/working-with-arduino-hardware-
support-package-for-matlab-aRaQK
• https://microcontrollerslab.com/program-arduino-
labview-example/
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink
62. Thank you
Webinar on Demystifying Data Acquisition: Access Data Through LabVIEW, MATLAB and Simulink