Datalogging in LabVIEW

Similar documents
Data Acquisition HANS-PETTER HALVORSEN,

Virtual Instruments with LabVIEW

DAQ in MATLAB HANS-PETTER HALVORSEN,

NI mydaq HANS-PETTER HALVORSEN, Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics

Control and Simulation in. LabVIEW

Solutions. Discretization HANS-PETTER HALVORSEN,

Data Acquisition in LabVIEW

State Estimation with Observers

Wireless DAQ using ZigBee

NI Vision System HANS- PETTER HALVORSEN,

University College of Southeast Norway. LM-900 Level Tank. Hans-Petter Halvorsen,

Høgskolen i Telemark Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics.

NI USB-TC01 Thermocouple Measurement Device

Simulation in LabVIEW. Hans-Petter Halvorsen, M.Sc.

Exercise 5: Basic LabVIEW Programming

Weather System. In this project you are going to create a Weather System, see Figure 1-1. Figure 1-1: Weather system

Faculty of Technology, Department of Electrical Engineering, Information Technology and Cybernetics. SCADA System

Wireless DAQ System. In this project you are going to create a Wireless DAQ System, see Figure 1-1. Figure 1-1: Wireless DAQ system

Laboratory System. 1 Introduction

Virtual Instrumentation With LabVIEW

Virtual Instrumentation With LabVIEW

Engineering Project-I. Module 1: Familiarization of LabVIEW and the Vernier Toolkit

Data Acquisition Laboratory

Determination of Drag Coefficient

Wireless Data Acquisition in. LabVIEW

Hands-on Lab 2: LabVIEW NI-DAQ Basics 2

LabVIEW Basics I: Introduction Course

Measurement & Automation Explorer (MAX) View and control your devices and software

BE/EE189 Design and Construction of Biodevices Lecture 5. BE/EE189 Design and Construction of Biodevices - Caltech

Hardware: Acquiring Data and Communicating with Instruments

LabVIEW MathScript Quick Reference

Introduction to LabVIEW

ME 224: EXPERIMENTAL ENGINEERING. Lecture 2

LabView programming 練習

Computer Interfacing Using LabView

Exercise 11: Discretization

The data acquisition components, and their relationship to each other, are shown below.

Industrial IT Laboratory Work Hans-Petter Halvorsen

LabVIEW Core 1. What You Need To Get Started. File Locations. The course installer places the course files in the following location: ni.

Hands-On Introduction to. LabVIEW. for Scientists and Engineers. Second Edition. John Essick. Reed College OXFORD UNIVERSITY PRESS

Certified LabVIEW Associate Developer Exam. Test Booklet

Analytical Instrumentation

Dept. of Electrical, Computer and Biomedical Engineering. Data Acquisition Systems and the NI LabVIEW environment

ni.com/training Quizzes LabVIEW Core 1 ni.com/training Courses Skills learned: LabVIEW environment Certifications Skills tested: LabVIEW environment

LabVIEW Tutorials. T.1 Temperature Measurement and Cold Junction Compensation (CJC) LUMS School of Science and Engineering

Introduction to National Instruments LabVIEW and Data Acquisition (DAQ)

INTRODUCTION TO LABVIEW

Certified LabVIEW Associate Developer Examination

Sensors and Actuators with Arduino. Hans-Petter Halvorsen, M.Sc.

Labview for Everyone (National Instruments Virtual Instrumentation Series) Jeffrey Travis

Certified LabVIEW Associate Developer Examination

Analytical Instrumentation

Lab Exercise 2: Data Acquisition with NI LabVIEW

Homework Assignment 9 LabVIEW tutorial

Step-by-Step Data Acquisition Part II Exercise 2: Generating an Analog Output Waveform

Small rectangles (and sometimes squares like this

Today. 4/5/11 Physics 262 Lecture 10 Questions about Exams Homework. Lab: Continue project. Lecture. Review your exams and review practice exam again.

CLAD Exam Preparation Guide using LabVIEW NXG

University College of Southeast Norway. Web Services. with Examples. Hans-Petter Halvorsen,

Using SQL Server in C#

OpenStax-CNX module: m Thermometer VI * National Instruments

Published in A R DIGITECH

1. Learn about LabView software and its different components

Lesson 4 Implementing a VI

Appendix C. Vernier Tutorial

Labview. Masood Ejaz

NI LabView READ THIS DOCUMENT CAREFULLY AND FOLLOW THE INSTRIUCTIONS IN THE EXERCISES

Read Temperature Data

Additional products and features

National Instruments Analog-to-Digital (NI A2D) Module Manual

Data acquisition hardware

Ch En 475: Introduction to Instrumentation and Signal Processing with Labview

Linear Control Systems LABORATORY

Lab 4 - Data Acquisition

Getting Started with LabVIEW Virtual Instruments

Introduction to LabVIEW Exercise-1

Ch En 475: Introduction to Instrumentation and Signal Processing with Labview

CLAD Sample Exam 03. C. A control that output a cluster of the controls / indicators on the tabs.

Strain and Force Measurement

Modbus Hans-Petter Halvorsen

Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics. MathScript

Exercise 0 - Open and Run a Virtual Instrument (Slide 12)

With respect to the National Instruments software product(s) being used, the following patents may apply:

ENGR 1000, Introduction to Engineering Design

CISE 318: Computer Control Systems Laboratory Exercises

Hands-on Lab. Open-Loop Response: System Identification

University College of Southeast Norway. Control and Simulation. in LabVIEW. Hans-Petter Halvorsen,

What s New in Data Acquisition

Lesson 1 Introduction to LabVIEW. TOPICS LabVIEW Environment Front Panel Block Diagram Dataflow Programming LabVIEW Help and Manuals Debugging a VI

PHY 351/651 LABORATORY 1 Introduction to LabVIEW

Speed Control of A DC Motor Through Temperature Variation Using NI ELVIS LabVIEW

LabVIEW programming I

NI-DAQmx Basic Course NITS John Shannon

LABVIEW LAB SKILLS ACTIVITY 1 PROGRAMING ENVIRONMENT

ENGR 1000, Introduction to Engineering Design

Arrays. Collection of data elements that are of same type

Introduction to Simulink

NAME EET 2259 Lab 3 The Boolean Data Type

BE/EE189 Design and Construction of Biodevices Lecture 1. BE/EE189 Design and Construction of Biodevices - Caltech

Using LabVIEW to Send Commands via RS232 to Ontrack Control Systems ADR Interfaces

Transcription:

Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics Datalogging in LabVIEW HANS-PETTER HALVORSEN, 2011.01.04 Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01

PREFACE In this lab you will learn basic Data Acquisition (DAQ) and how to use a DAQ unit in LabVIEW. We will use the USB-6008 DAQ device from National Instruments. NI USB-6008 is a simple and low-cost USV based multifunction I/O device from National Instruments. The device is well suited for training and education purpose. The purpose of data acquisition is to measure an electrical or physical phenomenon such as voltage, current, temperature, pressure, or sound. PC-based data acquisition uses a combination of hardware, software, and a computer to take measurements. The principle of Data Acquisition: USB-6008 DAQ device from National Instruments: ii

TABLE OF CONTENTS Preface... ii Table of Contents... iii 1 Introduction to Data Acquisition...4 2 Datalogging...8 3 Additional Tasks...15 iii

1 INTRODUCTION TO DATA ACQUISITION In this task we will learn basic Data Acquisition in LabVIEW. We will use the USB-6008 DAQ device. Background information for this task is described in detailed in the Tutorial Data Acquisition in LabVIEW. The Tutorial consists of pdf documents, videos, example code, additional resources and links. http://home.hit.no/~hansha/?tutorial=daq The purpose of data acquisition is to measure an electrical or physical phenomenon such as voltage, current, temperature, pressure, or sound. PC-based data acquisition uses a combination of modular hardware, application software, and a computer to take measurements. While each data acquisition system is defined by its application requirements, every system shares a common goal of acquiring, analyzing, and presenting information. Data acquisition systems incorporate signals, sensors, actuators, signal conditioning, data acquisition devices, and application software. So summing up, Data Acquisition is the process of: Acquiring signals from real-world phenomena Digitizing the signals Analyzing, presenting and saving the data 4

5 Introduction to Data Acquisition The DAQ system has the following parts involved, see Figure: The parts are: Physical input/output signals DAQ device/hardware Driver software Your software application (Application software) The NI-DAQmx 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. The DAQmx palette in LabVIEW: The DAQ Assistant, included with NI-DAQmx, is a graphical, interactive guide for configuring, testing, and acquiring measurement data. With a single click, you can even generate code based on your configuration, making it easier and faster to develop complex operations. Because DAQ Assistant is completely menu-driven,

6 Introduction to Data Acquisition you will make fewer programming errors and drastically decrease the time from setting up your DAQ system to taking your first measurement. NI USB-6008 is a simple and low-cost multifunction I/O device from National Instruments. The device has the following specifications: 8 analog inputs (12-bit, 10 ks/s) 2 analog outputs (12-bit, 150 S/s) 12 digital I/O USB connection, No extra power-supply neeeded Compatible with LabVIEW, LabWindows/CVI, and Measurement Studio for Visual Studio.NET NI-DAQmx driver software The NI USB-6008 is well suited for education purposes due to its small size and easy USB connection. Measurement & Automation Explorer (MAX) provides access to your National Instruments devices and systems. With MAX, you can: Configure your National Instruments hardware and software Create and edit channels, tasks, interfaces, scales, and virtual instruments Execute system diagnostics View devices and instruments connected to your system Update your National Instruments software In addition to the standard tools, MAX can expose item-specific tools you can use to configure, diagnose, or test your system, depending on which NI products you install. As you navigate through MAX, the contents of the application menu and toolbar change to reflect these new tools.

7 Introduction to Data Acquisition

2 DATALOGGING In this task we will connect our DAQ device to a real process (small-scale model). Below we see the Lab Equipment available for this assignment: Level Tank Air Heater In this Lab we can select one of these models. Which one you use is not relevant for the purpose of this lab work. Documents of how to use the Level Tank/Air Heater and the USB-6008 DAQ device is available from http://home.hit.no/~hansha. Level Tank: http://home.hit.no/~hansha/?equipment=leveltank Air Heater: http://home.hit.no/~hansha/?equipment=airheater USB-6008: http://home.hit.no/~hansha/?equipment=usb6008 Task 1: Test DAQ Device on Real Process Select one of the processes above and connect you DAQ device to the system. Log data (Temperature for the Air Heater system or Level for the Water Tank) for different input signals (u). Show the results in a Chart. You may want to use the Waveform Chart located in the Graph palette: 8

9 Datalogging Here is a LabVIEW example: Scaling: Make sure to scale the output signal from the system (Voltage signal) to Temperature (Air Heater) or Level (Water Tank). Air Heater output: 1-5V 20-50 o C. Water Tank output: 0-5V 0-20cm. The following linear relationship applies:

10 Datalogging You have to find a (slope) and b (intercept). The following formulas may be used: This gives: where It is good practice to implement the scaling using a SubVI. [End of Task] Task 2: Manual Control Try to act like a controller: Let s say you want the setpoint to be 15cm (Level Tank)/35 degrees C (Air Heater) and then try to manually adjust the control signal (u) so the Temperature stays on the setpoint. You need to extend the program from a previous task so that the control signal u is sent to the DAQ unit. Use the DAQmx Write.vi :

11 Datalogging [End of Task] Task 3: Write to Measurement File Extend your program so the logged data can be saved to a Measurement File. You can use the Write to Measurement File function on the File I/O palette in LabVIEW for writing data to text files (use the LVM data file format, not the TDMS file format which give binary files). Recommended settings for the Write To Measurement File :

12 Datalogging Example of LabVIEW Program: Open the *.lvm file in, e.g., Notepad in order to see the results. [End of Task]

13 Datalogging Task 4: Read from Measurement File: Create another program that open the measurement file and shows the data in an array and a Graph. Use the Read From Measurement File in LabVIEW. Recommended settings for the Read From Measurement File : Example of LabVIEW program:

14 Datalogging You should also open the file in Excel and plot the data in Excel. [End of Task] Task 5: Import Data to Excel In this task we will open the measurement file created in a previous task in MS Excel. Open the measurement file in Excel Calculate the average (mean) of the logged data (use the built-in mean function in Excel) Create a plot of the logged data [End of Task]

3 ADDITIONAL TASKS Task 6: Datalogging and Virtual Instruments Create a Virtual Instrument with the following components: 1. Toolbar 2. Owned Label 3. Numeric Control 4. Free Label 5. Numeric Control Terminal 6. Knob Terminal 7. Numeric Constant 8. Multiply Function 9. Icon 10. Knob Control 11. Plot Legend 12. XY Graph 13. Wire Data Path 14. XY Graph Terminal 15. Bundle Function 16. SubVI 17. For Loop Structure Below we see the front panel and the block diagram for the virtual instrument. 15

16 Additional Tasks The SubVI (number 16) shall read the temperature from the Air Heater using the USB-6008 DAQ (Data Acquisition) device.

17 Additional Tasks

Telemark University College Faculty of Technology Kjølnes Ring 56 N-3914 Porsgrunn, Norway www.hit.no Hans-Petter Halvorsen, M.Sc. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics Phone: +47 3557 5158 E-mail: hans.p.halvorsen@hit.no Blog: http://home.hit.no/~hansha/ Room: B-237a