Basic Data Acquisition with LabVIEW

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

Linear Control Systems LABORATORY

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

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

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

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

Getting Started with LabVIEW Virtual Instruments

ME 365 EXPERIMENT 3 INTRODUCTION TO LABVIEW

ME 224: EXPERIMENTAL ENGINEERING. Lecture 2

Lab Exercise 2: Data Acquisition with NI LabVIEW

Homework Assignment 9 LabVIEW tutorial

Introduction to LabVIEW Exercise-1

ECE 463 Lab 1: Introduction to LabVIEW

LabVIEW Express VI Development Toolkit User Guide

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

2 Lab 2: LabVIEW and Control System Building Blocks

Small rectangles (and sometimes squares like this

Lab 1: Getting familiar with LabVIEW: Part I

Lab 4 - Data Acquisition

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

Lesson 4 Implementing a VI

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

LabVIEW programming I

AOE 3054 LabView Programming

INTRODUCTION TO LABVIEW

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

Labview. Masood Ejaz

Computer Interfacing Using LabView

LabVIEW programming I

Introduction to LabVIEW

Introduction to National Instruments LabVIEW and Data Acquisition (DAQ)

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

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

OpenStax-CNX module: m Thermometer VI * National Instruments

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

ECE 202 LAB 1 INTRODUCTION TO LABVIEW

Lab 2: Introduction to LabVIEW 8.5

Virtual Instrumentation With LabVIEW

Introduction to LabVIEW

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

A. Front Panel Design Lesson 4 Implementing a VI

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

ENGR 1000, Introduction to Engineering Design

Tutorial: Getting Started with the LabVIEW Simulation Module

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

II. LAB. * Open the LabVIEW program (Start > All Programs > National Instruments > LabVIEW 2012 > LabVIEW 2012).

PHY 351/651 LABORATORY 1 Introduction to LabVIEW

Advanced Programming Features

Virtual Instrumentation With LabVIEW

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

Certified LabVIEW Associate Developer Exam. Test Booklet

DSP First Lab 02: Introduction to Complex Exponentials

Introduction to LabVIEW

Introduction to Labview and Temperature Measurement

PHYC 500: Introduction to LabView. Exercise 8 (v 1.3) M.P. Hasselbeck, University of New Mexico. Arrays, XY Graphs, Disk I/O

Module 2, Add on lesson Introduction to the NXT and Mindstorms software. Student. 45 minutes

LABVIEW LAB SKILLS ACTIVITY 1 PROGRAMING ENVIRONMENT

Above Threshold Warning of Temperature Data

Module 2, Add on lesson Introduction to the NXT and Mindstorms software. Teacher. 45 minutes

The LabVIEW Programming Environment and Basic Operations

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

Figure 1: Control & Simulation Loop

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

Microsoft Powerpoint 2013

Certified LabVIEW Associate Developer Exam. Test Booklet

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

Sema Foundation ICT Department. Lesson - 18

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

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

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

Shift Register: Exercise # 1: Shift Register Example VI. 1. Build the following front panel. Figure (8.1): Shift register exercise front panel

Section 1 Establishing an Instrument Connection

Hands-on Lab. LabVIEW Simulation Tool Kit

Maple Quick Start. Maplesoft, a division of Waterloo Maple Inc.

Simply Personnel Screen Designer

Table 1. Inputs and Outputs

Certified LabVIEW Associate Developer Examination

Training material. Introduction to LabVIEW

ENGR 1000, Introduction to Engineering Design

Engineering Innovation Center LabVIEW Basics

Virtual Instruments with LabVIEW

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

Certified LabVIEW Associate Developer Examination

Exercise 5: Basic LabVIEW Programming

Illustrator Domains 1-4: Getting to Know Your Workspace. Dreamweaver Domain 3

Read Temperature Data

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

The iworx 214 and LabScribe V2.0 Tutorial. Overview

Chapter 6 Data Acquisition and Spectral Analysis System high-speed digitizer card for acquiring time-domain data. The digitizer is used in

Software Introduction

The Mathcad Workspace 7

Cycle through three routing modes (ignore, avoid or push obstacle) Toggle electrical grid on/off

LabVIEW & FRC. BAA Fall Education Day 2015

1. Select the Insert tab. 2. Click the Picture command in the Images group. The Insert Picture dialog box appears.

CLAD_80.questions.

Keys for selecting tools

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

v SMS 12.2 Tutorial Observation Prerequisites Requirements Time minutes

WAYLAND FREE PUBLIC LIBRARY 3D Design and Printing Tutorial: Create a Keychain

TUTORIAL. Ve r s i on 1. 0

Transcription:

Basic Data Acquisition with LabVIEW INTRODUCTION This tutorial introduces the creation of LabView Virtual Instruments (VI s), in several individual lessons. These lessons create a simple sine wave signal, with controllable amplitude and frequency, and it is measured by a separate signal sampling device. Both signals are displayed, and signal acquisition effects such as aliasing and saturation can be observed. LESSON 1: INTRODUCTION TO VI COMPONENTS & TOOLS A LabVIEW VI consists of two separate windows: the front panel and the block diagram. Think of a typical electrical box, where the front of the box has all of the meters and switches, and the components that connect the switches and meters are located inside the box. The LabVIEW front panel is similar to the front panel of the electrical box, and the LabVIEW block diagram is similar to the innards of the electrical box. That is, the outputs and inputs of the VI go on the front panel, and the mathematics, conditions, and algorithms behind the inputs and outputs go in the Block Diagram. Open LabVIEW from the Start Menu All Apps N NI LabVIEW SP1 (32-bit). In the getting started window that comes up, selelct Create Project Blank VI Finish. The block diagram and front panels of a new, untitled VI will appear. In the front panel window, use File Save As to save your VI in a user-modifiable location. LabVIEW is notorious for crashing frequently without warning, so it is best to save your work often. Next, open up the Tools Palette, View Tools Palette, if it is not already open. You have several different tools at your disposal while editing the VI, and they change when you switch between the block diagram and front panel. You can use the palette, or you can sequence through the tools by pushing the Tab key. Available tools: Extended Index Finger: Acts as if the object you are manipulating is fixed and that its behavior cannot be modified. Use this tool to toggle buttons and enter values into text boxes. Arrow: Use this to modify objects instead of interact with them. With the arrow you can resize objects, move them around, and select them. Text Cursor: Use this cursor to edit any text fields in the Block Diagram and Front Panel. You can also add text to the block diagram and front panel with this tool. Spool of Wire: This cursor only works in the Block Diagram. Use it to create wires between different objects, so that they interact with each other. These are the fundamental tools. The rest of the tools are explained within the LabVIEW help files.

Now go to the Block Diagram. Right Click in the workspace so that the Functions menu pops up. These are all of the LabVIEW objects available for the Block Diagram. Select Express Exec Contronl While Loop, and create a rectangle by holding down the mouse at the top-left of the Block Diagram and dragging down to the right before releasing. Once LabVIEW enters the while loop, things within it continue to execute until the Boolean condition at the stop sign is met. Return to the Front Panel. Right Click in the workspace to bring up the Controls menu, and select Express Buttons Text Button. Place this button in the bottom right of the workspace. Use the Text Cursor to change the text within the button to Exit, and the label above it to Exit. Next, Right Click on the button to bring up its menu. De-select Visible Items Label to hide the label above the button. In the same menu, select Mechanical Action Switch Until Released to change the behavior of the button accordingly. Your front panel should now look like the panel in Figure 1. Figure 1: Front Panel with Exit Button Return to the Block Diagram. Notice an object has been created, named Exit, for the button you created in the front panel. Use the arrow cursor to move it inside the while loop you created. Then use the Wire Cursor to create a wire between it and the stop sign. The Block Diagram should resemble the one below, in Figure 2.

Figure 2: Block Diagram of Exit The While Loop will now run until the button is clicked on the Front Panel. Try it out by saving your work and clicking on the arrow up near the menu bar to see your VI work. Click on the button to end it. You have now created your first functional VI! LESSON 2: VIEWING A SIGNAL LabVIEW is very good at interfacing with laboratory equipment and bringing signals into the computer. You probably don t have access to this equipment, so we will create a signal within our VI using LabVIEW objects. We will also add editable fields to adjust the signal s magnitude and frequency. Right-click in the front panel of the same file as before. Select Graph Indicators Waveform Graph, and place the graph in the top left corner of the screen. Rename the label at the top-left of the graph to Original Signal. Right-click in the front panel again, and select Num Ctrls Num Ctrl, and place this text box to the left of the graph. Place another Num Ctrl right below. Label the first Num Ctrl Amplitude, and the second Num Ctrl Frequency. Change the Amplitude value to 1, and the Frequency value to 5. Right-click inside the text-box of each Num Ctrl and select Data Operations Make Current Value Default. This forces the values to start at 1 and 5. One you have made these changes, the front panel should now look like Figure 3 below.

Figure 3: Front Panel with Waveform Graph Now go to the block diagram. Drag the three new blocks, Original Signal, Frequency, and Amplitude, inside the while loop. These blocks represent the numbers and signal that appear on the front panel. Add a fourth block by right-clicking in the screen and selecting Signal Processing Wfm Generation Sine Wfm. This block creates a sine wave signal based on numbers that are provided to it using block diagram wires. Use the wire spool tool to see all the connections that can go into the block. You should see, clockwise from top, the following connectors: reset signal, offset, signal out, error out, sampling info, error in, phase, amplitude, and frequency. You can get more information for each of these connectors by selecting Help Show Context Help, and selecting the block in question. With the wire-spool tool, right click on the phase connector of the Sine Wfm block. Select Create Constant. This automatically attaches a constant number to a connector. Leave this value at 0. Move the blocks around inside the while loop so that the Frequency and Amplitude blocks appear to the left, so the Sine Wfm block appears in the middle, and so the Original Signal block appears on the right. Use the wire spool cursor to connect the blocks together as shown in Figure 4. Save and run the script. The front panel should be similar to Figure 5.

Figure 4: Block Diagram Connections Figure 5: Front Panel During Run LESSON 3: BUILDING THE SAMPLING WAVEFORM We will now add a second graph, which will acquire the original signal at a userspecified sampling frequencing and display the samples.

Figure 6: Final Front Panel Add the numerical controls and second graph as shown in Figure 6. The second graph, at bottom, is an XY Graph, and it can be found by right-clicking in the screen and selecting Graph Indicators XY Graph.

Figure 7: Final Block Diagram Modify your block diagram as shown in Figure 7. Most of the new blocks can be found by right-clicking and selecting Programming Mathematics Numeric and Programming Comparison. The smaller box with an N in the upper-left-hand corner is a for loop (Programming Structures). It executes all of the components inside of it N times. In our case, it executes the same number of times as the sample frequency. The other for-loop variable, i, counts from 0 to N-1, incrementing once for each iteration of the for-loop. We multiply i with the period of the sampling frequency, which we find using the 1/x block. This gives us a value for the time of one sample. We use a compound arithmetic block (Programming Numeric Compound Arithmetic, place the block and right click on it click Change Mode Multiply right click again and click Add input) to multiply (Programming Numeric) the time with constant 2*pi (Programming Numeric Math Constants), and with the frequency of the actual signal. We then take the sin of this value (Mathematics Elementary Triginometric), and multiply it by the amplitude of the actual signal. This completes the equation y = A*sin(2*pi*f*t). The y value is then passed through an In Range & Coerce block (Programming Comparison) to demonstrate saturation. If y is greater than Max Signal Strength or less than Max Signal Strength*(-1) (Programming Numeric Negate), then it is coerced to one of these extremes. The t and y values are automatically compiled into arrays by the for loop. Array signals appear thicker than scalar signals, as shown in Figure 7. The two arrays are then bundled into a

cluster (Programming Cluster, Class, & Variant Bundle), which makes a compatible signal for the XY Graph. Operation of the virtual instrument should now be seamless and error free Figure 8: Good Sampling.

Figure 9: Degraded Sampling.

Figure 10: Aliasing. The 10 Hz signal folds and appears as a 1 Hz signal.

Figure 11: More Aliasing. The sampled signal frequency does not match the original signal.

Figure 12: Saturation.