http://home.hit.no/~hansha/?
page=labview
Introduction to DAQ
with LabVIEW
TC-01
Thermocouple
with Self-paced Step-by-Step Exercises Hans-Petter Halvorsen, M.Sc.
Contents
• LabVIEW
• What is DAQ?
• Using TC-01 Thermocouple Device in LabVIEW
• Plotting
• Datalogging
• Measurement Filter
LabVIEW Installation
Note! You get the Serial Number from your Teacher,
but the software can be used for 30 days before you
Download the software here: need to enter a valid Serial Number.
http://home.hit.no/~hansha/?page=labview
These are the main modules we use in the different
courses at Telemark University College:
• LabVIEW (LabVIEW Professional Development System 32-Bit: English)
• NI-DAQmx (Hardware Driver for NI USB-6008, NI TC-01, etc.)
• LabVIEW Control Design and Simulation Module
• LabVIEW MathScript RT Module
Note! These packages are separate downloads!
All LabVIEW Software can be downloaded here: www.ni.com/download
Additional LabVIEW Resources
Here you will find lots of Videos, Tutorials and Exercises
• LabVIEW Training for Students (National Instruments):
http://ni.com/students/learnlabview
• LabVIEW Course:
http://home.hit.no/~hansha/?training=labview
Learning by Doing!
It is recommended that you watch some of the videos before you read furter
Hardware Air Heater
USB-6008
Wi-Fi DAQ
Water Tank
Pt-100
TC-01
Arduino
ZigBee
Vision System
cRIO
NOx Sensor
LabVIEW
This is the core LabVIEW installation that installs
the LabVIEW Programming Environment.
LabVIEW MathScript RT Module
This module is a text-based tool that is very similar to MATLAB. The syntax
is similar to MATLAB, you can create and run so-called m files, etc. The
module is available from the Tools menu inside LabVIEW.
LabVIEW Control Design and Simulation Module
This module is used for creating Control and Simulation applications
with LabVIEW. Here you will find PID controllers, etc. The module is
available as a palette on your block diagram.
NI-DAQmx
DAQmx is the Hardware Driver needed in order to use hardware devices like NI
USB-6008, NI TC-01, etc. inside LabVIEW. The module is available as a palette on
your block diagram.
http://www.ni.com/pdf/manuals/376039a.pdf
DAQ
Hans-Petter Halvorsen, M.Sc.
DAQ Hardware Examples
NI TC-01 Thermocouple Temperature Measurements
We will use this
device
NI USB-6008 I/O Module
Analog/Digital Inputs/Outputs
Note! The DAQmx Driver is needed in order to use them inside LabVIEW!!
DAQ – Data Acquisition Your App created
with LabVIEW
Sensors, etc.
A DAQ System consists of 4 parts:
NI TC-01 Thermocouple Device NI DAQmx Driver
1. Physical input/output signals, sensors
or
2. DAQ device/hardware
NI USB 6008 DAQ Device
3. Driver software
4. Your software application (Application software)
Using TC-01 in LabVIEW
Hans-Petter Halvorsen, M.Sc.
TC-01
How-To use TC-01 with LabVIEW
Connect device to
PC using USB
USB
Hans-Petter Halvorsen, M.Sc.
NI TC-01
Temperature (Thermocouple) Device
Used to log Temperature Data using the LabVIEW software
DAQmx Driver needed!
The NI USB-TC01 provides connections for one thermocouple. Thermocouple types J, K, R,
S, T, N, E, and B are supported. At TUC we will use the J type.
Getting Started with TC-01
The following window should pop up automatically when you plug in your NI USB-TC01
device in your USB port (if not, select “TC01Launcher.exe”):
Students: Plug in the device into your USB port and see if this window appears
NI TC-01 Built-in Temperature Logger
Built-in Temperature Logger (No Driver or programming needed)
Students: Test the Built-in Temperature Logger, Log Data to File, etc.
MAX – Measurement & Automation Explorer
Students: Make sure that your device can be located in MAX. Run a “Self-Test” and
use the “Test Panels” to make sure the device works properly.
Data Acquisition Palette in LabVIEW
Functions Palette: “Measurement I/O” -> “NI DAQmx”
For more “advanced” DAQ we use these functions
For basic DAQ we use
the DAQ Assistant
Students: Make sure that you have this palette installed. If not, install the latest
DAQmx driver!
LabVIEW DAQ Assistant
When you place the DAQ
Assistant on the Block
Diagram, a Wizard
automatically pops up
where you configure what
you want to do, i.e., if you
want to Read or Write
Data, Analog or Digital
signals, which channel you
want to use, etc.
LabVIEW DAQ
Select Input/Output Type
Assistant
Set Properties
Select Channel
Read Data from TC-01 Device
You create the Numeric
Indicator on the Front Panel
Students: Create this Example and Run the Program
Plotting
Hans-Petter Halvorsen, M.Sc.
Plotting
Temperature
Data
Students: Create this Example
and run the program
Plot Configuration
In most cases it is recommended
that you turn off ”Autoscaling”
Click on the axis to set Min
and Max values
Students: Try this.
Clear Plot Contents
Right-Click
Students: Try this.
X-Axis Scaling
How-To Show ”Real-Time” on X-Axis
Note! This is in
Seconds
Right-click and select Properties
Make the x Scale show Real Time
Note! For TC-01:
Max 4 samples per
second (see Data
Sheet) Note! This is in milliseconds Students: Try this.
Using Property Nodes
Here we will learn to set Properties
from LabVIEW Code instead of
setting them in the Property
Window, etc. This is very useful!
Here we have used “Property Nodes” in order to set
proper scaling on X-Axis and clear the Chart
Students: Try this.
Multiple
Plotting and
using SubVIs
SubVI
Students: Create this
Example and run it
Select Inputs and Outputs
SubVI
Input Output
Icon that makes it easier
to understand what the
(Control) (Indicator) SubVI is doing
A SubVI is the same as a
function or a method used
in other languages
Datalogging
Hans-Petter Halvorsen, M.Sc.
Save Data to File (Datalogging)
Right-click-Properties
Recommended Settings
Recommended Settings
Datalogging Example
Datalogging Example – Block Diagram
Students: (1) Log Temperature Data, both Celsius and Fahrenheit (use SubVI) to a
“Measurement File”. (2) Then Plot the Data in the File in Excel.
(3) You should also create a new VI in LabVIEW where you plot the data from the File
in a Graph and in an Array.
Read from Measurement File - Example
Block Diagram
Right-click-Properties
Recommended Settings
Recommended Settings
Using a Lowpass Filter to reduce Noise
Functions palette: Express -> Signal Analysis -> Simulate Signal
Functions palette: Express -> Signal Analysis -> Filter
Students: Create this Example.
Then Include the Filter in your Logging Application
Properties
Measurement Filter
from Scratch
(You may skip this part)
Hans-Petter Halvorsen, M.Sc.
Lowpass Filter/Measurement Filter
The measured signals contains noise, so we should remove the noise using a Filter
The differential equation for a Measurement filter may be given as:
Since we shall implement the Measurement Filter in a computer, we need to make a dicrete version
of the filter. We use the Euler Backward discretization method:
Where Ts is the Sampling Time
Then we get:
Or:
This discrete Measurement Filter can be easily
where implemented in a computer using e.g.,
LabVIEW, C#, etc.
LabVIEW Formula Node
Formula Node: Create and use C code
within LabVIEW
Example:
Students: Use the LabVIEW Formula Node.
in order to implement the Measurement Filter.
Lowpass Filter/Measurement Filter - Example
Students: Implement this Example using a
LabVIEW Formula Node.
When finished, try to log data from your
sensor with and without the Measurement
Filter. Compare the results.
Testing the Filter
In this example we add noise to a Sine
function. We then use the Measurement
Filter to see if we can remove the noise
afterwards.
Students: Try this Example.
Next: Use the Filter on your Datalogging System
As you can see this gives a
good results.
The filter removes the noise
from the signal.
Additional LabVIEW Resources
Here you will find lots of Videos, Tutorials and Exercises
• LabVIEW Training for Students (National Instruments):
http://ni.com/students/learnlabview
• LabVIEW Course:
http://home.hit.no/~hansha/?training=labview
Learning by Doing!
It is recommended that you watch some of the videos before you read furter
Do you need more Practice? - Select a Challenge
Hans-Petter Halvorsen, M.Sc.
Temperature Logging
1. Create Logging App:
• Log the temperature in your house e.g., during the night using the TC-01
Thermocouple device.
• Plot the temperature in a Chart
• Log the temperature to a File
2. Create Analysis App:
• Read the temperature data from the file into LabVIEW
• Find Max temperature and Min temperature using built-in functions in LabVIEW
• Find also the Average/Mean temperature and the Standard deviation using built-in
functions in LabVIEW
3. Do Analysis in Excel:
• Import the data into Excel and create a Plot
• Find Max, Min, Mean/AVG, SD using Excel
• Compare the results
Hans-Petter Halvorsen, M.Sc.
University College of Southeast Norway
www.usn.no
E-mail: [email protected]
Blog: http://home.hit.no/~hansha/