Lab experience 1: Introduction to LabView

Similar documents
ME EN 363 ELEMENTARY INSTRUMENTATION Lab: Basic Lab Instruments and Data Acquisition

Introduction To LabVIEW and the DSP Board

Virtual instruments and introduction to LabView

Analyzing and Saving a Signal

ENGR 1000, Introduction to Engineering Design

Data Acquisition Using LabVIEW

LabView Exercises: Part II

Basic LabVIEW Programming Amit J Nimunkar, Sara Karle, Michele Lorenz, Emily Maslonkowski

Getting Started with the LabVIEW Sound and Vibration Toolkit

Table of Contents Introduction

ENGR 1000, Introduction to Engineering Design

DSP Laboratory: Analog to Digital and Digital to Analog Conversion *

Lab 1 Introduction to the Software Development Environment and Signal Sampling

NanoGiant Oscilloscope/Function-Generator Program. Getting Started

Fig. 1. The Front Panel (Graphical User Interface)

Spectrum Analyser Basics

MIE 402: WORKSHOP ON DATA ACQUISITION AND SIGNAL PROCESSING Spring 2003

The BAT WAVE ANALYZER project

Experiment 2: Sampling and Quantization

E X P E R I M E N T 1

Experiment 13 Sampling and reconstruction

Exercise 5-1. Troubleshooting Techniques EXERCISE OBJECTIVE DISCUSSION OUTLINE DISCUSSION. Signal flow tracing

Experiment # 5. Pulse Code Modulation

Digital Logic. ECE 206, Fall 2001: Lab 1. Learning Objectives. The Logic Simulator

DSP First Lab 04: Synthesis of Sinusoidal Signals - Music Synthesis

Quick Reference Manual

Quick Start for TrueRTA (v3.5) on Windows XP (and earlier)

LabView Exercises: Part III

Lab 2: A/D, D/A, and Sampling Theorem

Appendix D. UW DigiScope User s Manual. Willis J. Tompkins and Annie Foong

Experiment P32: Sound Waves (Sound Sensor)

Background. About automation subtracks

LMH0340/LMH0341 SerDes EVK User Guide

MODFLOW - Grid Approach

Cisco Spectrum Expert Software Overview

Exercise 5. Troubleshooting a QAM/DQAM Modem EXERCISE OBJECTIVE DISCUSSION OUTLINE DISCUSSION. Signal flow tracing

v. 8.0 GMS 8.0 Tutorial MODFLOW Grid Approach Build a MODFLOW model on a 3D grid Prerequisite Tutorials None Time minutes

Operating Instructions

Altera s Max+plus II Tutorial

Experiment 9A: Magnetism/The Oscilloscope

WAVES Cobalt Saphira. User Guide

MestReNova Manual for Chem 201/202. October, 2015.

Ultra 4K Tool Box. Version Release Note

SR-D8-M, SR-D8-S. (Ver ) SOFTWARE INSTRUCTIONS

Digital Signal Processing Laboratory 7: IIR Notch Filters Using the TMS320C6711

Activity P32: Variation of Light Intensity (Light Sensor)

Laboratory 5: DSP - Digital Signal Processing

Working with a Tektronix TDS 3012B Oscilloscope EE 310: ELECTRONIC CIRCUIT DESIGN I

Exercise #1: Create and Revise a Smart Group

Manual of Operation for WaveNode Model WN-2m. Revision 1.0

(Skip to step 11 if you are already familiar with connecting to the Tribot)

Pre-processing of revolution speed data in ArtemiS SUITE 1

SigPlay User s Guide

Recording of Coincidence Signals in a Software Medium

NJU26125 Application Note PEQ Adjustment Procedure Manual New Japan Radio Co., Ltd

There are many ham radio related activities

USB Mini Spectrum Analyzer User s Guide TSA5G35

VISSIM TUTORIALS This document includes tutorials that provide help in using VISSIM to accomplish the six tasks listed in the table below.

Boonton 4540 Remote Operation Modes

Rack-Mount Receiver Analyzer 101

How to Build A Table of Authorities in Word * By: Morgan Otway

DIGITAL PORTABLE RECORDER TRAINING MANUAL FOR COURT REPORTING OFFICERs

B2 Spice A/D Tutorial Author: B. Mealy revised: July 27, 2006

Interactive Virtual Laboratory for Distance Education in Nuclear Engineering. Abstract

PHYSICS OF MUSIC. 1.) Charles Taylor, Exploring Music (Music Library ML3805 T )

Integration of Virtual Instrumentation into a Compressed Electricity and Electronic Curriculum

Please feel free to download the Demo application software from analogarts.com to help you follow this seminar.

PHY221 Lab 1 Discovering Motion: Introduction to Logger Pro and the Motion Detector; Motion with Constant Velocity

MTL Software. Overview

What s New in Raven May 2006 This document briefly summarizes the new features that have been added to Raven since the release of Raven

Analysis of AP/axon classes and PSP on the basis of AP amplitude

Analyze Frequency Response (Bode Plots) with R&S Oscilloscopes Application Note

Software Quick Manual

Scan Converter Installation Guide

Standard Operating Procedure of nanoir2-s

imso-104 Manual Revised August 5, 2011

USING MEDIACAST FOR LIVE EVENTS THERE ARE THREE SEPARATE KEYS NEEDED TO ACCESS THE FRONT AND BACK OF THE VIDEO CART.

B I O E N / Biological Signals & Data Acquisition

Performing Signal Integrity Analyses

Experiment # 4 Counters and Logic Analyzer

Transmitter Interface Program

Lab 5 Linear Predictive Coding

Scan Converter Quick Installation Guide

Formatting Dissertations or Theses for UMass Amherst with MacWord 2008

Capstone Experiment Setups & Procedures PHYS 1111L/2211L

Session 1 Introduction to Data Acquisition and Real-Time Control

CCE900-IP-TR. User s Guide

Acoustic Measurements Using Common Computer Accessories: Do Try This at Home. Dale H. Litwhiler, Terrance D. Lovell

VivoSense. User Manual Galvanic Skin Response (GSR) Analysis Module. VivoSense, Inc. Newport Beach, CA, USA Tel. (858) , Fax.

SignalTap: An In-System Logic Analyzer

ENGR 40M Project 3b: Programming the LED cube

Topic: Instructional David G. Thomas December 23, 2015

Realizing Waveform Characteristics up to a Digitizer s Full Bandwidth Increasing the effective sampling rate when measuring repetitive signals

Chapter 1. Introduction to Digital Signal Processing

A few quick notes about the use of Spectran V2

EndNote for Windows. Take a class. Background. Getting Started. 1 of 17

ONE SENSOR MICROPHONE ARRAY APPLICATION IN SOURCE LOCALIZATION. Hsin-Chu, Taiwan

4.9 BEAM BLANKING AND PULSING OPTIONS

Word Tutorial 2: Editing and Formatting a Document

LEDBlinky Animation Editor Version 6.5 Created by Arzoo. Help Document

Transcription:

Lab experience 1: Introduction to LabView LabView is software for the real-time acquisition, processing and visualization of measured data. A LabView program is called a Virtual Instrument (VI) because it, with the proper sensors, can simulate an electronic instrument such as an oscilloscope. Each VI is programmed in two windows: a front panel that provides the user interface, and a block diagram that does the data acquisition and mathematics. The block diagram uses a graphical programming interface that mimics the wiring between integrated circuits (op-amps, microprocessors, etc.) within an electronic device. You can do the same mathematical functions in LabView that you can do in MATLAB, but LabView is good for real-time operations while MATLAB is more efficient for post-processing. The first part of this exercise is meant to get you familiar with the LabView interface. The second part starts a VI that you can use to do frequency-domain analysis of acoustic signals. Part 1: Familiarization Items in red are tips that are not part of the procedure skip them if you like. 1. Open LabView. On our lab computers, the sequence is All Programs >> National Instruments Labview 2014 SP1. If necessary, click the Launch LabVIEW button. 2. Click Help >> Find Examples in the start window. Click the Search tab, search for running then open the Running Average with Shift Registers VI. The first window you see is the Front Panel, which contains one Control (the stop button) and one Indicator (a plot window). 3. Run the VI by clicking Operate >> Run, or ctrl-r, or the white arrow in the upper left corner. The plot shows some random numbers (blue diamonds) and a running average over the most recent four points (red line). Press the Stop button to stop the VI. 4. By default, LabView automatically changes the pointer to match each object (e.g. cross, arrow, text cursor, hand/finger). If you would rather select the pointer yourself, select View >> Tools Palette, then click off the green bar. You can then choose any of the tools shown in the palette. Clicking it again restores automatic selection. Either way, try moving or resizing the displays using the arrow. 5. If your VI is ready to run, there will be a white arrow in the upper left corner of the window. If not, there will be a broken gray arrow. Clicking on a broken gray arrow will bring up a list of errors so you can address them. 6. Select Window>>Show Block Diagram. In it, the large gray rectangle represents a while loop. The green T F box and tiny stop sign determine when the loop stops, and the watch in the yellow box controls how fast it runs. Icons represent functions, numbers, and information passing to or from the front panel. The Print date: 10/8/2015 1

icons are connected by wires, as if the program were built in a circuit. The wires color and pattern indicate the data type that they carry. Some examples: blue for integer, red for floating point, green for logical (true/false); narrow line for scalar, thick line for 1-D array, double line for 2-D array. The wires also carry information from function to function as if the wires were variables. 7. The red triangles on the left and right borders are Shift Registers, which store a number from one iteration of the loop to the next. There are three arrows on the left border because the previous three numbers are being stored for averaging. Small rectangles represent constants, inputs, or outputs. Rectangles with bold outlines typically represent controls (inputs from the front panel), while rectangles with narrow outlines are indicators (outputs to the front panel). 8. Select Help>>Show Context Help. Note that the Context Help window displays details about whichever component is under the mouse pointer. 9. Right-click the block diagram to bring up the Functions palette, pin it to the desktop, then expand it with the down arrows at the bottom of the window. You might want to do Customize >> Change Visible Categories and select all. Then select Programming >> Structures, and note the variety of structures that are analogous to functions in standard programming code. For example, to put functions in a for-next loop, you actually place icons and wires into the For Loop structure, or draw the loop around existing icons. Information enters on the left, is processed within, and exits on the right through tunnels. The structures of most importance to us are the While Loop, For Loop, Case Structure (equivalent to if-then-else code), and MathScript node. If you do not see the MathScript icon in Programming, you might find it under Mathematics >> Scripts and formulas >> Script nodes. The MathScript node allows us to include MATLAB code in the LabView VI so that we do not need to program complicated mathematical formulas icon by icon. 10. While viewing the block diagram, run the VI. While it is running, click the light bulb (Highlight Execution) and observe the flow of data through the diagram. Note that highlighting execution slows down the VI. 11. Stop and close the running average VI, and find the Moonlanding VI in the G:\327\LabView folder. Play for a while, but not too long. 12. Switch to the block diagram, and note the collection of large blue icons. Each of these is an interactive function box, called an Express VI. They can perform signal input & output, mathematics, file input and output, signal processing, and timing. Print date: 10/8/2015 2

13. Sometimes the Express VI s make our lives easier, especially when dealing with data acquisition and output. Sometimes they are just complicated ways to do simple functions. You can double-click on each Express VI to see their internal settings and options. 14. Before moving to a data input/output example, note the blue dashed lines traversing the Moonlanding block diagram. This is LabView s Dynamic Data Type which means that it can represent any of a variety of signal types. It can be good for plotting acquired signals, but I often like to convert a signal to a simple array because arrays make it easier for me to use the raw data. Part 2: Your data acquisition and output VI for today Purpose: Generate a LabView VI that will do the following: Send signals (e.g. fast and slow square waves) from your computer via its sound card; Receive signals from another computer via your computer s sound card; plot the signal in the time domain; analyze the component frequencies and plot the magnitude spectrum. Teams: Write your programs in teams of two. Each team will pair up with the team across the table from them to send and receive signals. Materials: One computer with LabView One audio cable with a 3.5 mm plug at both ends Optional: function generator, computer microphone, earphones or speaker. Record-keeping: Your VIs will be your primary record of your accomplishments. Each time you achieve a working system, i.e. one that you believe can perform the necessary tasks well (even if those tasks are only a subset of the final goals of your project), save the VI with a unique name. In addition, record in a text file or in your notebook how you have divided up the work between you and between your two teams. Also record the major discoveries, accomplishments, and decisions you have made during this lab experience. One advantage of working in your notebook is that you can draw sketches of the signals and flowcharts as you go. 1. If you are using a microphone, plug it into the computer. Right click the Volume Settings >> Recording Devices, and verify that the green bars indicate sound input. If you are using speakers, plug them in and verify that you can get sound out. It can be problematic to plug these components in after writing your VI. 2. (Re)Start LabView so that it recognizes the speaker. Create a blank VI, and switch to the block diagram. You will want to acquire a sound signal, so place Print date: 10/8/2015 3

this icon on the diagram: Functions > Express > Input > Acquire sound. Use one channel and a sampling frequency of 11025 Hz. Click OK. 3. Expand the Acquire sound icon by dragging down the lower border. Right click the Data output triangle, and Create > Graph indicator. 4. Switch to the front panel and run the VI. After one second you should see a signal on the graph (probably noise, unless you have a microphone attached). 5. You want your VI to run continuously, so add a While loop on the block diagram (Programming > Structures > While). Drag the loop around both icons. Right click the stop sign in the lower right corner and Create > control. Double click the Stop icon, and it will be highlighted on the front panel. Run the VI, and notice that you can stop it by pressing the Stop button. 6. On the block diagram, on the Acquire sound icon, right-click the Duration input triangle and Create > Control. On the front panel, enter 0.5 in the Duration (s) field. When you run the VI the chart should update itself every 0.5 seconds. 7. You can multiply the sampling rate by the duration and find the number of samples that are supposed to be in each signal. However, the actual signal often has fewer, and this is very important for frequency analysis. Let s see how many samples we get. Place a Programming > Array > Array size icon near the Data graph icon. Wire the blue Data wire to the Array size input (left side of the icon). You should see a new icon that changes the blue wire to a red one, i.e. a Dynamic Data Type to a simple Array. Right click the Array Size output and Create > Indicator. The indicator on the front panel will show the number of samples collected in each iteration of the While loop. With 0.5-second duration, one channel and f S = 11025 Hz, I got 4134 samples on my home computer, but you might get up to 5512. 8. You should be able to run your VI now and see the incoming signal on the front panel. Signal output 9. Open G:\327\LabView\sound_output_template.vi, which contains the basic components of an unfinished sound output VI. 10. In the while loop on the block diagram, you should find a function generator icon: Signal Processing > Waveform Generation > Basic function generator, along with controls for frequency, amplitude, signal type, and sampling info; the output waveform is wired to the input terminal of the Sound Output Write icon. 11. Optional: use speakers to verify the output, but be careful! Low amplitudes or volumes are usually adequate, and sine waves can be annoying and auditorily destructive at high volume. Print date: 10/8/2015 4

12. Optional: Connect your speaker output to the microphone input of your computer (or the line out to the line in), and verify that your signal acquisition VI can capture the signal from your output VI. 13. Working with your own input & output sockets, or with another team and their computer, transmit a variety of waveforms, including sinusoids, triangle waves and square waves. 14. Question: Can you reliably transmit a low-frequency square wave on the order of 1-2 Hz or so? If so, super-duper! If not, what might be causing the shape you observe? How can you upgrade your transmitter and receiver to send a low frequency signal such as this using the sound card? Is this upgrade part of today s lab assignment? 1 Writeup and demonstration By this time you have already saved a few versions of your software as a record and for your future use. You do not need to submit these for a grade. In your notebook, record the waveforms that you observe in your transmitting and receiving VIs before and after the upgrade. Compare to what you expect, propose reasons that the signal might be altered, and supporting evidence. Include sketches in your notebook of the frequency spectrum showing how your transmission / reception VI manipulated the signal in the frequency domain. You do not need to include formal Purpose, Methods, Results, Discussion sections. Demonstrate your VI(s) for the instructor or TA. Be prepared to explain how the VI works and the principles behind the signal processing, and use the frequency domain sketches to support your explanation. Show the notes you have kept in your notebook, and obtain instructor/ta initials at the time of the demo. You will hand in your lab notebook after next week s lab exercise, and you will receive scores for both labs 1 and 2 at that time. 1 Yes! Print date: 10/8/2015 5

Advanced exercises 1. Frequency analysis Now it is time for you to apply your knowledge of discrete Fourier transforms to add frequency-measurement functionality to your VI. ON PAPER, write a flow chart that shows how you will take your signal and determine the dominant frequency (the one with highest amplitude) over the duration when you captured the signal. Be as detailed as you can. Show the flow chart to the instructor and you will get help finding the functions you need. 2. Reading a.wav file You may modify your VI to read a pre-recorded file rather than generating a waveform. Before doing so, save the VI under a new file name. Delete the Basic Function Generator and its associated controls. Replace it with Programming > Graphics and Sound > Sound > Files > Simple Read, then create a control for the Path input. The data output will probably contain two channels, which should be split with Programming > Array > Index Array. Wire the file data to the Index Array input, then its output should be a single channel that you can use in the same way as you used the signal that your Basic Function Generator created. Print date: 10/8/2015 1

General notes a) Charts collect incoming data in a buffer, so one datum per loop is sufficient. Graphs discard all previously received data, so one point per loop is not enough. b) Controls and indicators may be interchanged by selecting Change to on the right-click menu. Note that the appearance usually changes on both the diagram and the front panel. c) On the front panel, pressing the space bar toggles the mouse pointer between the finger (change input) and arrow (move/size display). On the diagram, the space bar cycles the pointer through the wire, arrow and finger. d) By default, new controls and indicators show up on the block diagram as squares like this. You can make them smaller by right clicking and unchecking show as icon. Control/indicator icons with bold outlines on the block diagram are represent controls on the front panel, while rectangles with narrow outlines represent indicators. e) Any VI can be used as a subroutine within a larger VI. Typically these sub-vis appear as white squares, which can be opened and edited (right click > Open front panel). They perform a variety of procedures and complicated mathematical functions. f) When complicated instrument drivers are involved, the fastest way to get the program you need is often to modify one of the example VI s. Open Help>>Examples>>I/O Interfaces>>DAQ Examples; the Analog Input and Analog Output lists contain the most useful starting points for our data acquisition hardware. Print date: 10/8/2015 1