LabVIEW DAQ and I/O Modules

Hans-Petter Halvorsen

LabVIEW

LabVIEW is a graphical programming language, and it has powerful features for simulation, control and DAQ applications. LabVIEW is developed by NI/Emerson. They have Professional paid versions or a free Community version for personal, non-commercial, non-academic and non-industrial purposes.

 

Below we see a typical LabVIEW program:

Since LabVIEW is a full-blood programming language (in a graphical way), you can use LabVIEW for almost everything, personally I use LabVIEW for Datalogging and Monitoring, DAQ, Control Systems, OPC, Database Systems, SCADA Systems, Hardware in the Loop Simulations and Testing, Modbus, etc.

LabVIEW (YouTube) - This video introduces the LabVIEW Programming Environment.

LabVIEW Fundamentals (YouTube Playlist) - This video series introduces all the key concepts and fundamental parts in LabVIEW.

LabVIEW Fundamentals Tutorial (PDF)

LabVIEW Fundamentals (Website) - Here you find lots of resources, tutorials, videos, etc. for learning the fundamentals in LabVIEW programming.

 

Installation of LabVIEW

Open the links below in order to download LabVIEW:

LabVIEW Software

Note! LabVIEW 32bit version (even if you have 64bit operating system) is recommended because some features and toolboxes are only supported by the 32bit version of LabVIEW.

You can use LabVIEW in Evaluation mode for some weeks, after that you will need a valid Serial Number. The Serial Number is provided by the LabVIEW responsible at your University/Workplace (assuming they have a valid license).

 

Below we go through the following:

 

 

Data Acquisition (DAQ)

Data Acquisition (DAQ) is the process of collection data from different sensors into a computer. A DAQ System consists of 4 parts: Physical input/output signals, sensors, DAQ device/hardware, driver software and your software application (Application software).

 

In this tutorial a TC-01 Thermocouple device and a USB-6008 (part of USB-600x DAQ series) DAQ device from NI/Emerson (formerly known as National Instruments) will be used to exemplify.

 

Here you find information about the TC-01 specifications. Here you find the TC-01 User Guide.

Here are some resources for the USB-6008: User Guide and Specifications for USB-6008 and USB-6008 Pinout.

 

 

DAQmx

To use DAQ Hardware in LabVIEW we need to use the DAQmx driver.

To use, e.g., the TC-01 Thermocouple device or the USB-6008 DAQ from NI/Emerson (formerly known as National Instruments), you need to install the NI-DAQmx driver.

 

Tutorial:

DAQmx in LabVIEW (YouTube) + PowerPoint (PDF) - Communicate with NI DAQ Devices in LabVIEW. The tutorial shows different ways to use the DAQmx functionality in LabVIEW with practical LabVIEW examples.

 

 

TC-01 Thermocouple Temperature Device

The TC-01 Thermocouple device from NI/Emerson (formerly known as National Instruments) can be used for measuing temperature data.

Here you find information about the TC-01 specifications. Here you find the TC-01 User Guide.

 

Tutorial:

TC-01 Thermocouple Temperature Device in LabVIEW (YouTube) + PowerPoint (PDF)

 

 

DAQ and I/O Modules

NI/Emerson (formerly known as National Instruments) has lots of different DAQ devices and I/O modules. Here will a USB-6008 be used to exemplify.

Here are some resources for the USB-6008: User Guide and Specifications for USB-6008 and USB-6008 Pinout.

Pinout:

 

Tutorials:

DAQ and I/O Modules in LabVIEW - Introduction (YouTube) + PowerPoint (PDF) - Here we use the USB-6008 DAQ device.

 

 

Analog Out

Here we use the Analog Out Channels on the DAQ device. We can connect a Multimeter for testing.

Analog Out Wiring example:

 

Tutorial:

DAQ and I/O Modules in LabVIEW - Analog Output (YouTube)

 

 

Analog Input

We can test the Analog Input channels by just reading the Voltage Value from a battery that is connected to the DAQ device.

Wiring example:

 

Tutorial:

DAQ and I/O Modules in LabVIEW - Analog Input (YouTube)

 

 

 

TMP36 Temperature Sensor

The TMP36 temperature sensor is a cheap and versaille sensor that can be used for many applications.

Wiring:

Note! The wires are connected as "RSE".

 

Here you see the relationship between voltage and the temperature in degrees Celsius:

The figure above is from the TMP36 Datasheet.

Formula for converting from Voltage to Temperature in Degrees Celsius: y = 100x - 50, where x is the value read from the DAQ device in voltage.

 

Tutorials:

TMP36 Temperature Sensor Overview

TMP36 Temperature Sensor in LabVIEW (YouTube) + PowerPoint (PDF)

Read Temperature Data with Lowpass Filter in LabVIEW (YouTube) + PowerPoint (PDF)

 

 

Thermistor Temperature Sensor

A thermisor temperature sensor is a cheap and versaille sensor that can be used for many applications.

 

Tutorials:

Thermistor Temperature Sensor Overview

Thermistor Temperature Sensor in LabVIEW (YouTube) + PowerPoint (PDF)

 

 

Digital Output

We can connect a Multimeter to see if the Application works as expected or we can connect a LED, etc.

Physical Wiring LED:

 

Wiring Shema LED:

Tutorial:

DAQ and I/O Modules in LabVIEW - Digital Output (YouTube)

 

 

Digital Input

For digital in we can use, e.g., a Push Button to set a Digital In to be False/Low (0V) or True/High (5V).

Physical Wiring:

 

Wiring Schema:

 

Pull-up Resistor

Why do we need a pull-up or pull-down resistor in the circuit? If you disconnect the digital I/O pin from everything, it will behave in an irregular way. This is because the input is "floating" - that is, it will randomly return either HIGH or LOW. That's why you need a pull-up or pull-down resistor in the circuit.

Below we see how the cuircuit with a Pull-up Resistor is working:

When the pushbutton is open (unpressed) there is a connection between 5V and the DI pin. This means the default state is True (High). When the button is closed (pressed), the state goes to False (Low).

Tutorial:

DAQ and I/O Modules in LabVIEW - Digital Input (YouTube)

 

 

Datalogging

Very often you may need to write and read data files, you may log data from a temperature sensor you want to save to a file, etc.

Write/Save Data to File Example:

Open/Read Data from File Example:

 

Tutorials:

Write and Read Data Files in LabVIEW (YouTube)

Logging Temperature Data to Text File in LabVIEW (YouTube) + PowerPoint (PDF)

Logging Data from Multiple Sensors to a Text File in LabVIEW (PDF)