Experiment 1: Introduction to Labview 8.0 (tbc 1/7/2007, 1/13/2009,1/13/2011)

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

Basic Data Acquisition with LabVIEW

Getting Started with LabVIEW Virtual Instruments

2 Lab 2: LabVIEW and Control System Building Blocks

Small rectangles (and sometimes squares like this

ME 365 EXPERIMENT 3 INTRODUCTION TO LABVIEW

Homework Assignment 9 LabVIEW tutorial

AOE 3054 LabView Programming

Introduction to LabVIEW

Lab 4 - Data Acquisition

Status Bar: Right click on the Status Bar to add or remove features.

INTRODUCTION TO LABVIEW

Exercise 5: Basic LabVIEW Programming

SystemVue 2011 Fundamentals (version ) LAB EXERCISE 1. SystemVue Basics

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

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

ENGR 1000, Introduction to Engineering Design

ME 224: EXPERIMENTAL ENGINEERING. Lecture 2

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

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

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

Lab 1: Getting familiar with LabVIEW: Part I

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

Figure 1: Control & Simulation Loop

LabVIEW Express VI Development Toolkit User Guide

Microsoft Excel 2010 Part 2: Intermediate Excel

Linear Control Systems LABORATORY

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

Numbers Basics Website:

Lesson 4 Implementing a VI

Lab Exercise 2: Data Acquisition with NI LabVIEW

PHYC 500: Introduction to LabView. Exercise 1 (v 1.3) M.P. Hasselbeck, University of New Mexico

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

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

PM4 + Partners Knowledge Articles

Lab 2: Introduction to LabVIEW 8.5

Introduction to LabVIEW. By Finn Haugen, TechTeach

LABVIEW HANDOUT 3 CHAPTER 3: THE MATHSCRIPT NODE AND XY GRAPH

Working with Excel CHAPTER 1

Introduction to LabVIEW Exercise-1

Introduction to Excel 2013

Contents. Group 2 Excel Handouts 2010

ECE 202 LAB 1 INTRODUCTION TO LABVIEW

A. Front Panel Design Lesson 4 Implementing a VI

Starting Excel application

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

EXCEL 2010 PROCEDURES

Introduction to LabVIEW

Read Temperature Data

OpenStax-CNX module: m Thermometer VI * National Instruments

Working with Excel involves two basic tasks: building a spreadsheet and then manipulating the

Getting Started With Excel

Technology Assignment: Scatter Plots

2.2 - Layouts. Bforartists Reference Manual - Copyright - This page is Public Domain

TABLE OF CONTENTS TABLE OF CONTENTS... 1 INTRODUCTION... 2 USING WORD S MENUS... 3 USING WORD S TOOLBARS... 5 TASK PANE... 9

Capstone Appendix. A guide to your lab computer software

Sema Foundation ICT Department. Lesson - 18

Computer Interfacing Using LabView

CISE 318: Computer Control Systems Laboratory Exercises

Eurostat Regions and Cities Illustrated: Usage guide

Basic Microsoft Excel 2007

Labview. Masood Ejaz

Working with Charts Stratum.Viewer 6

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

Microsoft How to Series

The LabVIEW Programming Environment and Basic Operations

WEEK NO. 12 MICROSOFT EXCEL 2007

Introduction Accessing MICS Compiler Learning MICS Compiler CHAPTER 1: Searching for Data Surveys Indicators...

GET130 Intro to Engineering Technology

SUM - This says to add together cells F28 through F35. Notice that it will show your result is

Excel 2007 New Features Table of Contents

LabView instrumentoinnissa, 55492, 3op Labview in instrumentation

Models for Nurses: Quadratic Model ( ) Linear Model Dx ( ) x Models for Doctors:

How to Create Greeting Cards using LibreOffice Draw

LabVIEW programming I

Introduction to National Instruments LabVIEW and Data Acquisition (DAQ)

NAME EET 2259 Lab 3 The Boolean Data Type

MS PowerPoint Useful Features. Choose start options. Change Office backgrounds and colours

Page 1 of 6. ME 3200 Mechatronics I Laboratory Lab 2: LabView Computer Systems. Introduction

Microsoft Excel 2007 Lesson 7: Charts and Comments

MDA V8.1 What s New Functionality Overview

For detailed instructions, click the links below. To ask questions, request features, or report problems, visit feedback.photoshop.com.

Faculty of Computing, Engineering and Technology. Real Time Systems 1 CE LabVIEW David D. Hodgkiss & Staffordshire University 1

Spreadsheet View and Basic Statistics Concepts

GWXSlider ActiveX Control

Creating Fill-able Forms using Acrobat 7.0: Part 1

Word 2013 Quick Start Guide

Microsoft Excel Tutorial

PARTS OF A WORKSHEET. Rows Run horizontally across a worksheet and are labeled with numbers.

Copyright 2015 Integrated Environmental Solutions Limited. All rights reserved.

2.1 System Dynamics Tool: STELLA Version 10 Tutorial 1. Introduction to Computational Science: Modeling and Simulation for the Sciences, 2nd Edition

MIS0855: Data Science In-Class Exercise for Mar Creating Interactive Dashboards

PowerPoint Basics (Office 2000 PC Version)

Stamina Software Pty Ltd. TRAINING MANUAL Viságe BIT VIEWER

GeoGebra 4. Introduction and Point Plotting

Excel 2003 Tutorial II

Excel Tables & PivotTables

Open Office Calc (Spreadsheet) Tutorial

AutoCAD 2009 User InterfaceChapter1:

WELCOME TO LabVIEW 1

Transcription:

Experiment 1: Introduction to Labview 8.0 (tbc 1/7/2007, 1/13/2009,1/13/2011) Objective: To learn how to build virtual instrument panels in Labview 8.0 Tasks: 1. Build the Labview VI shown in the tutorial given in Appendix A. 2. Modify the VI such that: a) The formula is now given by x = Asin( ω 1t) + Bcos( ω2t) b) The input nodes are now: amplitudes A and B, frequencies ω 1 and ω 2, and elapsed time t. This means you need to include three more controls that allow the user to adjust the first four variables. c) Instead of sliders, use [Numeric Ctrl] controls. This means you do not need to attach a numeric indicators to the Numeric Ctrl controls. Further, these allow the user to input values directly. Change the properties of the Numeric Ctrl controls to match Table A. (see Figure A.) Numeric Ctrls: A and B Numeric Ctrls: w1and w2 Table A. Minimum 0 Maximum 0.5 Increment 0.01 Minimum 0 Maximum 10 Increment 0.01 Figure A. Modified Front Panel 1

Appendix A: Tutorial for Labview 8.0 I. Initalizing a blank virtual instrument. 1. Log on to Labview 8.0 and open a Blank VI. (see Figure 1.) Select this. Figure 1. Opening a blank virtual instrument (VI). 2. Two windows will appear: a) the Front Panel and b) the Block Diagram. (You could tile both windows side-by-side by selecting [Window] [Tile Left and Right] menu item as shown in Figure 2). Figure 2. The Front Panel and Block Diagram windows. Remarks: i) The Front Panel will contain the user interface such as knobs, buttons, indicators and graphs while the Block Diagram window will contain the inner-circuitry (including objects, wirings and other virtual instruments), logic structures (including programming blocks) and timing commands. ii) If either the Front Panel or the Block Diagram window is blocked by another window (e.g. when either window is maximized), one can toggle the focus between the two windows by pressing [CTRL]-[E]. 2

II. Building a VI. ( Sliders, Functions and Charts ) Description: We will now build a virtual instrument (VI) project that produces a sinusoidal signal whose frequency will be adjusted by a slider. We will also monitor the signal using a strip chart and save the results in a text file. Procedure: 1. Access the Functions-pallete. [Right-click] on the mouse cursor while inside the block-diagram window, then tack -on the Functions-pallete (see Figure 3). Figure 3. Tack-on by clicking on the the push-pin. 2. Create a While-Loop box. By clicking on the dark triangles in the Functions palette, one can expand or reduce different icon-subdirectories of available functions. Expand to the [Express] [Exec Control] subdirectory, then click-on the [While-loop] icon and go to the block-diagram window to create an area for the while-loop function as shown in Figure 4. Click these triangles to expand/reduce icon menus. Figure 5. Click the while-loop icon, then drag an area in the Block Diagram window. 3

Remarks: i) A [STOP] button will also appear in the front-panel window. ii) You can have several Function palettes open at the same time. iii) You could select or de-select Function Groups (e.g. Mathematics, Express, etc.) by checking or un-checking the items under the [View] [Always Visible Catogories] submenu, as shown in Figure 6. Click here. Figure 6. Selecting and deselecting function groups. NOTE: For the items below, make sure that all the objects created are inside the [while-loop] box. 3. Build a Formula Node. In the Functions palette, expand the [Mathematics] [Scripts & Formulas] icon subdirectory, then click on the [Formula Node] icon. In the Blockdiagram window, drag an area then enter the formula: x=sin(w*t); as shown in Figure 7. (Remember to include the semicolon). 4

Figure 7. Introduce a Formula node block. Move the cursor to hover around the left edge of the Formula-node block, then [Right-Click] and select [Add Input]. A small box should appear. Name it: w. Add another input node and name it: t. Similarly, hover around the right edge of the Formula-node block, [Right-Click] and select [Add Output], then name it: x. (The output nodes will have a thicker boundary, see Figure 8). Figure 8. Adding input and output variables. 4. Insert the Elapsed Time block then connect it with the t input. From the Functions palette, expand the [Programming] [Timing] icon subdirectory and select the [Elapsed Time] icon. Drop the object inside the Block-diagram window. A Configure Elapsed Time window should appear. Disable the [Automatically reset ] checkbox, then click the [OK] button. (See Figure 9.) 5

Leave unchecked. Figure 9. Insert an Elapsed Time block. Let the cursor hover around the Elapsed Time (s) selection until the cursor changes to a wire-spooling cursor. Next, [Click-drag] the spool until it hovers near the t input node of the Formula-node block and then release. A connecting wire should then appear. You may need to resize the Whileloop box and/or move the Formula-node block to make room for the desired wiring between the Elapsed Time block and the Formula-node block. (See Figure 10). Wire spool cursor Figure 10. Wiring the elapsed time values to the t input node. Remarks: i) To save space, you could [Right-click] the Elapsed time block and select the [View as Icon] menu item. This should reduce the block to be an icon (See Figure 11.) 6

Figure 11. Elapsed Time block reduced into an icon. ii) When the cursor is in the pointer mode, a [Click-drag] could be used to move or remove blocks and wires. Figure 12. Pointer cursors. iii) Frequently, a wire may become broken. This is usually marked by an X on the broken wires as shown in Figure 13. This means that the broken wire that has one unattached end. To remove all broken-wires in the Block-diagram window, press [CTRL-B]. Figure 13. A broken wire. 5. Add a horizontal Slider control. [Right-Click] at a region in the Front Panel window and then [Click] the push pin to access the Controls palette. Expand in the Controls palette, the [Express] [Numeric Controls] icon subdirectory, then select the horizontal [Pointer Slide] icon and drop it inside the Front Panel window. [Double-Click] the Slider label and rename it as as Frequency (rad/s). (See Figure 14.) 7

Click here to change font size and styles of selected texts. Figure 14. Setting a horizontal slider. Next, go to the Block Diagram window and make sure that the Frequency (Slider) block is inside the While-loop box. (If not, drag it inside.) Move the cursor around the small output triangle node at the right edge of the Frequency (Slider) block until the wire-spool cursor appears, then drag a wire to connect the Frequency (Slider) block to the w input node of the Formula node block. (See Figure 15.) Figure 15. Connecting the output of Slider block to one of the inputs of Formula node block. 6. Add a Chart control. [Click] at a region in the Front Panel window and access the Controls palette. Under the [Express] [Graph Indicators] icon subdirectory, select the [Chart] icon then drop a Chart control in the Front Panel window. Rename the Chart control to SINE WAVE. (See Figure 16). 8

Figure 16. Adding a Chart control inside the Front Panel window. Next, go to the Block Diagram window and make sure that the SINE WAVE (Chart) block is inside the While-loop box. (If not, drag it inside.) Move the cursor around the small input triangle node at the left edge of the SINE WAVE (Chart) block until the wire-spool cursor appears, then drag a wire to connect the SINE WAVE (Chart) block to the x output node of the Formula node block. (See Figure 17) Figure 17. Connect the x output node to the SINE WAVE block. 7. Add a Wait Until Next Multiple ms block. Access the Function palette and expand the [Programming] [Timing] icon subdirectory. Select the [Wait Until ] icon, then drag it into the Block Diagram window. ( See Figure 18). 9

Figure 18. Add a Wait block into the Block Diagram window. Next, move the cursor and [Right-Click] at the left node of the Wait block. A menu should appear. Select [Create] [Constant], then change the value of the constant to: 10. This means that the while loop will be activated after 10 milliseconds. (See Figure 19). [Right-Click] here. Figure 19. Attaching a constant value to the Wait block. 8. Run/Test the VI project. [Click] the Run button to run the VI (see Figure 20). Move the Frequency slider and observe what happens to the plot. You can [Click] the [STOP] button to terminate the run. RUN button. Figure 20. Running the VI project. 10

Remarks: i) The chart labels in the SINE WAVE chart are the default labels. One usually needs to rename these labels. ii) The horizontal axis are in terms of While loop iterations. This means in our example, with the Wait time of 10 milliseconds, the value of 9935 in Figure 20 means 99.35 seconds of elapsed time. Moreover, the range of samples shown in the chart is (10035-9935)=100 or 1 second. iii) It is advisable to save the VI frequently, specially when it works as desired. 9. Enhance/Modify the VI project and Add File Output. Include a numeric indicator to the Frequency (slide) control. (see Figure 21) - In the Front Panel window, access the Controls palette and expand to the [Express] [Numeric Indicators] icon subdirectory. Select the [Num Ind] control and drop into the Front Panel window. Position the Numeric Indicator control to the right of the Frequency (slide) control. - [Right-Click] the Numeric Indicator control and select the [Properties] menu item, then match the entries given in Table 1. - In the Block Diagram window, make sure Numeric Indicator block is inside the While loop box. Position the cursor at a point in the wire connecting the Frequency (slide) block and the Formula Node block until the wire spool appears. Then drag a wire to connect it with the Numeric Indicator block. Table 1. Properties used for Numeric Indicator shown in Figure 21. Tab Item Value Display Format Format Floating Point Digits 3 Precision Type Hide Trailing Zeros Digits of Precision <unchecked> Appearance Label : Visible <unchecked> 11

Numeric Indicator Figure 21. Adding a Numeric Indicator control to the Frequency (slider) control. Add a Change to Dynamic Data block. (see Figure 22) - In the Block Diagram, remove the wire connecting the Function node block and the SINE WAVE chart. - Access the Functions palette and expand the [Express] [Signal Manipulation] icon subdirectory. Select [to DDT] icon (in some versions this is [to Dynamic Data]), then drag the block to somewhere between the Function node block and the SINE WAVE chart. - Wire the x output node to the input (left) node of the to DDT block. Also, wire the right (right) node of the to DDT block to the signal node of SINE WAVE chart. (Note that the second wire will be thicker. This type of wiring represents dynamic data, which means that time-information is now attached to the original data stream.) - [Right-Click] the to DDT block, then select the [Properties] menu item. Match the values given in Table 2. 12

Table 2. Properties used for to DDT block in Figure 22. Item Conversion Start time Value Single scalar Now to DDT block Figure 22. Insertion of a to DDT block which converts a single stream of data to dynamic data. Modify the properties of the SINE WAVE chart. - [Right-Click] the SINE WAVE chart in the Front Panel window, then select [Properties] menu item. Match the values given in Table 3. (see Figure 23) 13

Table 3. Modified Properties of SINE WAVE chart. Tab Variable Item Value Format and Precision Scales Time( x-axis) Time(x-axis) Amplitude (y-axis) Type Time Format AM/PM HH:MM:SS Absolute time Custom time format <on> <on> Digits 1 Date Format Name Autoscale Date unused Time <unchecked> Minimum 0 Maximum 10 Name Autoscale x-values <unchecked> Minimum -1 Maximum 1 Figure 23. Modified chart properties. 14

Add Write Meas File block (see Figure 24) - Access the Functions palette and expand the [Express] [Output] icon subdirectory, then select the [Write Meas File] block and add inside the While loop box. - Reduce the block to an icon ([Right-Click] and select [View as Icon]) to save space. - Connect the Signal node of the Write Meas File block to the thin (orange) wire connecting Function Node block and the to DDT block. - [Right-Click] the Write Meas File block and select [Properties] menu item. Match the values given in Table 4. - Test the VI then check the output file using Excel. Note that the time included in the file will be the elapsed time, incremented by 0.01 seconds due to our chosen wait time of 10 milliseconds. Table 4. Properties used for Write Meas File block. Item No headers One column per channel Value <on> <on> 15

Figure 24. Final Block-Diagram window including a Write Meas File block. 16