DAQ in LabVIEW

Hans-Petter Halvorsen

Delivery  

Introduction

Video: LabVIEW in Automation - DAQ in LabVIEW + PowerPoint (PDF)

Prerequisites: Basic LabVIEW Programming

 

Hardware

We need the following Hardware in this module:

Other handy hardware: Screwdriver 2.5mm, Battery (1.5V or 9V), Multimeter

 

These components are very easy to use and cost almost "nothing". If you have an Arduino Kit, a temperature sensor is typically included.

You will also find lots of Temperature Sensors at Kjell & Company.

 

Note! If you don't have one or more of the temperature sensor listed, you can use another sensor, or even a battery as illustated below.

 

Software

NI-DAQmx - Driver for Hardware from National Instruments, like TC-01 Thermocouple, USB-6001 or USB-6008, etc.

Here you find more information about NI-DAQmx.

 

 

DAQ in LabVIEW

A DAQ System consists of 4 parts: (1) Physical input/output signals, (2) sensors DAQ device/hardware, (3) Driver software and (4) Your software application (LabVIEW). LabVIEW is well suited for creating DAQ applications and many hardware devices are supported.

 

The video below introduces the term Data Acquisition (DAQ) and how to use it in LabVIEW:

Introduction to DAQ in LabVIEW (Video)

Note! The video uses a TC-01 as an example. You dont need this device. We will use a USB-6008 DAQ device/I/O module.

PowerPoint used in the Video (Tutorial)

 

 

USB-6008 in LabVIEW

USB-6008 is a multifunction I/O Device from National Instruments.

The National Instruments USB-6008 is a low-cost, multifunction data acquisition device (DAQ). It has 8 analog inputs, 2 analog outputs, and 12 digital input/outputs. The digital channels are divided into two ports. When one or more channels on each port is set to either input or output, the port is locked into that particular mode.

 

Make sure to read the User Guide and Specifications for USB-6008 and USB-6008 Pinout.

 

The USB-6008 uses the NI-DAQmx driver software and is compatible with LabVIEW (but also C#, MATLAB, etc).

 

You should watch the Videos/Tutorials below for each topic. Make sure to actually do the examples by yourself in LabVIEW.

 

In the video below you learn how to use the USB-6008 in LabVIEW:

USB-6008 in LabVIEW (Video)

PowerPoint used in the Video (Tutorial)

 

Multimeter

When testing Analog Out (or Digital Out) you can e.g., connect the USB-6008 to a multimeter to test if the signal is as expected.

 

Loop-back Test

When testing Analog In/Out Pins (or Digital In/Out) you can also use a so-called "Loop-back" Test. here you just wire the input and out put together as illustrated.

 

 

DAQ Tutorials

You should go through the following resources:

Temperature Sensors

TMP36 Temperature Sensor Overview

Thermistor Temperature Sensor Overview

 

Temperature Sensors Tutorial + LabVIEW Code

 

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

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

 

Using LEDs

What is an LED?

What is a Resistor? + Resistor Calculator

 

LED Examples Tutorial + LabVIEW Code

LED in LabVIEW (Video) + PowerPoint (PDF)

 

Low-pass Filter

Implementing Low-pass Filter in LabVIEW (Tutorial)

Low-pass Filter in LabVIEW (Video) + PowerPoint (PDF)

 

 

 

Logging to Text Files

When acquiring data from a DAQ device or an I/O Module you typically want to store the data to either a File, a Database or an OPC Server Here we will use the “Write To Measurement File” in LabVIEW as an example If you don’t have a DAQ device or an I/O Module you can create a simple Simulator as exemplified later in this Tutorial.

Logging to Text Files in LabVIEW (Tutorial)

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

 

 

Fritzing

Fritzing is an open source software for design of electronics hardware and creating circuit diagrams Documentation is important! Creating professional circuit diagrams is important, so you should consider using a tool like Fritzing for designing and documentation of your circuit diagrams.

Download from http://fritzing.org

 

 

LabVIEW Programming Guidelines

Typically engineers often create simple LabVIEW VIs that eventually grow out of control, because they don't have the proper structure and best practices. The solution to this problem is organizing your code and data in a way that enables modularity, readability, and reuse.

Some examples are:

For more details, see the video below.

Video: LabVIEW Programming Guidelines

PowerPoint used in the Video

 

LabVIEW Programming using State Machine

Video: LabVIEW State Machine

Tutorial

Download Code

 

 

Delivery

Use a USB-6008 I/O Module to collect data and do some basic analysis of the data using both the 2 different temperature sensors (both TMP36 and Thermistor).

Logging Data from Multiple Sensors to a Text File in LabVIEW

Requirements:



Submission: Document your LabVIEW Application (both GUI and code) and deliver a PDF (e.g, 5-8 pages). Here you find a Word Report Template you can use for your report. You can use another template if you prefer. Make sure you fulfill all items in this Checklist before you deliver your Report.

Please follow the "LabVIEW Programming Guidelines" as shown and explained in this video: LabVIEW Programming Guidelines.

Where should you deliver? Canvas

What should you deliver? Only PDF File - No LabVIEW Code

The text should primarily be reflective and not descriptive. The text should not merely describe what has been done, but also why and how and what the results are. The outcome needs to be put into relevant context.

The document (pdf) can be built up as follows (the so-called IMRaD model):

  1. Introduction: This documentation can start with a brief introduction, i.e. describe what you have made, what is the purpose with the program, etc. Typically, you should also include a System Sketch. A System sketch is an illustration/figure of your system, the different parts the system consists of, and how they relate to each other.
  2. Methods and Results (Overview of the Work that has been done and the Results): Include one or more images of the User Interface (Front Panel) and Code (Block Diagram). These should also be briefly described in the text.
  3. Discussions and Conclusion/Summary: Discuss your Results. Finally, a brief summary/conclusion of your work. Does you program work as expected? Why/Why Not, any improvements that needs to be made with your program, etc.

Write Technical Reports in Microsoft Word - Here you learn the basic structure of a Technical Report, how to insert Figure Captions and refer to those in the text, how to insert Equations and refer to those in the text, how to add References, etc.

More information about IMRaD.

Make sure to insert Figures, Tables and Equations correctly, please see the video Equations in Word and PowerPoint.

Referencing: If you have used external sources, you need to use referencing. In scientific documents we typically use the IEEE standard, see Kildekompasset for details. Citation and Referencing with Microsoft Word (YouTube)

Remember to have focus on the technical work that has been done (as you have learned that technical/ professional documentation should be written), i.e., you should NOT tell how much you have learned, that the assignment was interesting and such things. Pretend that you write this documentation for a Customer that have asked you to make this program and document the Methods used and the Results achieved.