Virtual Instruments with LabVIEW

Similar documents
Datalogging in LabVIEW

Solutions. Discretization HANS-PETTER HALVORSEN,

Data Acquisition HANS-PETTER HALVORSEN,

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

NI Vision System HANS- PETTER HALVORSEN,

Wireless DAQ using ZigBee

Control and Simulation in. LabVIEW

Exercise 5: Basic LabVIEW Programming

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

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

Introduction to LabVIEW

DAQ in MATLAB HANS-PETTER HALVORSEN,

State Estimation with Observers

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

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

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

NI USB-TC01 Thermocouple Measurement Device

Laboratory System. 1 Introduction

LabVIEW programming I

Data Acquisition in LabVIEW

Linear Control Systems LABORATORY

LabVIEW MathScript Quick Reference

Getting Started with LabVIEW Virtual Instruments

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

Exercise 11: Discretization

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

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

ME 224: EXPERIMENTAL ENGINEERING. Lecture 2

c01.qxd p /18/01 11:03 AM Page 1 Fundamentals

Introduction to National Instruments LabVIEW and Data Acquisition (DAQ)

The LabVIEW Programming Environment and Basic Operations

Analytical Instrumentation

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

OpenStax-CNX module: m Thermometer VI * National Instruments

Learn the three palettes. Learn how data is passed in LabVIEW. Create a subvi using two different methods.

Computer Interfacing Using LabView

Virtual Instrumentation With LabVIEW

Using LabVIEW. with. BiPOM Boards. Quick Start Guide. Document Revision: Date: 18 September, 2009

LabVIEW programming I

OVERVIEW GOALS KEY TERMS

ME 365 EXPERIMENT 3 INTRODUCTION TO LABVIEW

Analytical Instrumentation

Virtual Instrumentation With LabVIEW

QuickStart Guide. LabVIEW QuickStart Guide. January 1998 Edition Part Number B-01

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

Wireless Data Acquisition in. LabVIEW

AOE 3054 LabView Programming

2. The LabView Environment Two panes will open, one is the Front panel, and one is the Block Diagram

Labview. Masood Ejaz

Introduction to LabVIEW Exercise-1

Linear Algebra in LabVIEW

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

LabVIEW. Table of Contents. Lesson 1. Pre-reqs/Technical Skills Basic computer use

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

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

University of Pennsylvania. Department of Electrical and Systems Engineering. ESE Undergraduate Laboratory. Introduction to LabView

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

Published in A R DIGITECH

Data Acquisition Laboratory

Basic Data Acquisition with LabVIEW

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

Arrays are lists of elements of the same data type. They are analogous to arrays in traditional languages.

Engineering Innovation Center LabVIEW Basics

LabVIEW TM Basics I Introduction Course Manual

Hardware: Acquiring Data and Communicating with Instruments

LabVIEW Basics I: Introduction Course

Read Temperature Data

User Manual. LabVIEW User Manual. July 2000 Edition Part Number C-01

Lab 4 - Data Acquisition

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

MATLAB Examples. Simulink. Hans-Petter Halvorsen, M.Sc.

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

LabVIEW: A Teaching Tool for the Engineering Courses

Concept: Debugging. Goal. Description. Implementation. Use the debugging tools built into LabVIEW.

Advanced Programming Features

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

CISE 318: Computer Control Systems Laboratory Exercises

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

Getting Started with the LabVIEW Real-Time Module

Small rectangles (and sometimes squares like this

Certified LabVIEW Associate Developer Exam. Test Booklet

Using SQL Server in C#

1. Learn about LabView software and its different components

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

Determination of Drag Coefficient

Introduction to Labview and Temperature Measurement

Lab 1: Getting familiar with LabVIEW: Part I

Basics I Course Manual. LabVIEW TM. LabVIEW Basics I Course Manual. Course Software Version 4.0 March 1998 Edition Part Number E-01

INTRODUCTION TO LABVIEW

Homework Assignment 9 LabVIEW tutorial

Using LabVIEW in Instrumentation and Control Course

OPC and Real-Time Systems. in LabVIEW

LabView programming 練習

LABVIEW LAB SKILLS ACTIVITY 1 PROGRAMING ENVIRONMENT

LabVIEW Demonstration Guide

Experiment 1: Introduction to Labview 2010 (tbc 1/7/2007, 1/13/2009,1/9/2012, 1/10/2012)

Lab Exercise 2: Data Acquisition with NI LabVIEW

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

LabVIEW. Getting Started with LabVIEW. Getting Started with LabVIEW

Lesson 4 Implementing a VI

Transcription:

Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics Virtual Instruments with 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

2 Virtual Instruments with LabVIEW Introduction LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a platform and development environment for a visual programming language from National Instruments. The graphical language is named "G". Originally released for the Apple Macintosh in 1986, LabVIEW is commonly used for data acquisition, instrument control, and industrial automation on a variety of platforms including Microsoft Windows, various flavors of UNIX, Linux, and Mac OS X. The latest version of LabVIEW is version LabVIEW 2010. Visit National Instruments at www.ni.com. LabVIEW programs are called Virtual Instruments, or VIs, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. LabVIEW contains a comprehensive set of tools for acquiring analyzing, displaying, and storing data, as well as tools to help you troubleshoot your code. Here we will go through some simple LabVIEW examples in order to learn basic LabVIEW programming. For more background information about LabVIEW, see the tutorial Introduction to LabVIEW.

3 Virtual Instruments with LabVIEW http://home.hit.no/~hansha/?tutorial=labview You may also want to take a closer look at the Interactive Training called LabVIEW Starter : http://home.hit.no/~hansha/training/labview/starter/

4 Virtual Instruments with LabVIEW Front Panel and Block Diagram In this task you will learn to create a simple user interface in LabVIEW and how to create the code for it. When you open a blank VI, an untitled front panel window appears. This window displays the front panel (the user interface) and is one of the two LabVIEW windows you use to build a VI. The other window contains the block diagram (the code). In LabVIEW, you build a user interface, or front panel, with controls and indicators. Controls are knobs, push buttons, dials, and other input devices. Indicators are graphs, LEDs, and other displays. Front Panel Example: If you right-click on the Front Panel, the Controls palette appears:

5 Virtual Instruments with LabVIEW Block Diagram Example: If you right-click on the Front Panel, the Functions palette appears:

6 Virtual Instruments with LabVIEW Task 1: Create a simple Calculator Step 1: Create the following front panel (user interface) in LabVIEW:

7 Virtual Instruments with LabVIEW Step 2: Create the block diagram (code) to make the program work as expected. Step 3: Push the Run button to do the calculations. [End of Task] Loops and Structures Like other programming languages have LabVIEW different Loops and structures available. The different Loops and Structures available are located in the Structures sub palette in the Functions palette on the Block Diagram. Task 2: Using While Loops Step 1: Create the following front panel: Step 2: Create the block diagram for the program using a While Loop. The Date and Time strings should be updated every second.

8 Virtual Instruments with LabVIEW You may want to use the following built-in functions in LabVIEW: [End of Task] Task 3: Create an advanced Calculator Create the following program: You need to use a While Loop and an Event Structure inside the While loop to solve the problem. The Event structure is used to respond to buttons clicks, such as when the user clicks the Calculate or Stop buttons. When the user clicks the Calculate button, the answer should be calculated. When the user clicks the Stop button, the program should stop running. [End of Task] Arrays Arrays are very powerful to use in LabVIEW. In all your applications you would probably use both onedimensional arrays and two-dimensional arrays. Task 4: Arrays Create the following program:

9 Virtual Instruments with LabVIEW [End of Task] SubVIs Creating and using SubVIs are very important in LabVIEW. A SubVI is like a function or subroutine in other languages. Here we will learn to create and use existing SubVIs. Task 5: SubVIs Step 1: Create a SubVI from the simple Calculator created in a previous task. You have to create an Icon for you SubVI using the Icon Editor:

10 Virtual Instruments with LabVIEW You also need to create input/output Connectors Step 2: Create a new program that uses the SubVI, like this: [End of Task] Plotting Data LabVIEW have powerful features for plotting different kind of data. Below we see the Graph palette in LabVIEW.

11 Virtual Instruments with LabVIEW Task 6: Plotting Create the following program: You may want to use the following function in order to create some random data: Create a Chart and use it inside a While Loop. [End of Task] Virtual Instruments Now you have learned the basic features in LabVIEW and you are ready to create your own Virtual Instruments. Task 7: Virtual Instruments

12 Virtual Instruments with LabVIEW In this task you will need everything you have learned so far (and probably a little more). 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.

13 Virtual Instruments with LabVIEW The SubVI (number 16) could be reading the temperature from a temperature sensor using a DAQ (Data Acquisition) device, but in our case we will just create a simple simulator using, e.g. the built-in Random Number VI to create random temperature values. We will learn more about acquiring data from DAQ devices later.

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 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