LAB II. INTRODUCTION TO LABVIEW

Similar documents
Lab 4 - Data Acquisition

LabVIEW Day 1 Basics. Vern Lindberg. 1 The Look of LabVIEW

Lab 3: Introduction to Data Acquisition Cards

EET 310 Programming Tools

EXPERIMENT NUMBER 5 BASIC OSCILLOSCOPE OPERATIONS

Annex: VISIR Remote Laboratory

AC Measurements Using the Oscilloscope and Multimeter by Mr. David Fritz

Exercise 10: Basic LabVIEW Programming

Getting Started on the Computer With Mouseaerobics! Windows XP

Oscilloscope, Function Generator, and Voltage Division

SW43W. Users Manual. FlukeView Power Quality Analyzer Software Version 3.20 onwards

Data Acquisition Using NI-DAQmx

Lab 1: The Digital Oscilloscope

Dash 18X / Dash 18 Data Acquisition Recorder

Dash 8Xe / Dash 8X Data Acquisition Recorder

Hands-On: Introduction to Object-Oriented Programming in LabVIEW

5. Tutorial. Starting FlashCut CNC

RLC Series Resonance

CATIA Basic Concepts TABLE OF CONTENTS

First Bytes Programming Lab 2

Electrical Resonance

User s Guide DDS-3X25 USB ARBITRARY FUNCTION GENERATOR

This activity will show you how to draw graphs of algebraic functions in Excel.

Lab 1: Full Adder 0.0

School of Electrical and Information Engineering. The Remote Laboratory System. Electrical and Information Engineering Project 2006.

FREQUENCY RESPONSE OF AN AUDIO AMPLIFIER

Lab #9: AC Steady State Analysis

GPIB Instrument Control

Electronic WorkBench tutorial

Cell Phone Vibration Experiment

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

Lab E1: Introduction to Circuits

CHAPTER 11: Flip Flops

MATERIALS. Multisim screen shots sent to TA.

Experiment 5. Lasers and laser mode structure

Lab 1: Introduction to Xilinx ISE Tutorial

LabVIEW Lesson 5 Clusters

PEMBINA TRAILS SCHOOL DIVISION. Information Technology Department. Inspiration 7.0

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

Experiment #11: LRC Circuit (Power Amplifier, Voltage Sensor)

Transmitter Interface Program

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

Introduction to LabVIEW

Windows XP Pro: Basics 1

Multi Channel software

CurveMaker v2.1 DYNAFS programmable ignition software

S7 for Windows S7-300/400

Building a Simulink model for real-time analysis V Copyright g.tec medical engineering GmbH

1 One Dimensional Horizontal Motion Position vs. time Velocity vs. time

HP 33120A Function Generator / Arbitrary Waveform Generator

Introduction to LogixPro - Lab

FREE FALL. Introduction. Reference Young and Freedman, University Physics, 12 th Edition: Chapter 2, section 2.5

Instructions for the ACER Laptops

Lab 1: Introduction to PSpice

ε: Voltage output of Signal Generator (also called the Source voltage or Applied

EXPERIMENT NUMBER 8 CAPACITOR CURRENT-VOLTAGE RELATIONSHIP

Dayton Audio is proud to introduce DATS V2, the best tool ever for accurately measuring loudspeaker driver parameters in seconds.

Step Response of RC Circuits

Keysight 14585A Control and Analysis Software

How to test and debug an ASP.NET application

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

Embroidery Fonts Plus ( EFP ) Tutorial Guide Version

STIM202 Evaluation Kit

How to read this guide

PLL frequency synthesizer

LabVIEW Day 6: Saving Files and Making Sub vis

Using Microsoft Project 2000

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

SIGNAL GENERATORS and OSCILLOSCOPE CALIBRATION

Introduction to LabVIEW for Control Design & Simulation Ricardo Dunia (NI), Eric Dean (NI), and Dr. Thomas Edgar (UT)

ACS Version Check Layout Design

Getting Started with the LabVIEW Mobile Module Version 2009

Model 288B Charge Plate Graphing Software Operators Guide

Job Scheduler User Guide IGSS Version 11.0

Making Basic Measurements. Publication Number August Training Kit for the Agilent Technologies Series Logic Analysis System

Before you can use the Duke Ambient environment to start working on your projects or

VisTablet Manual. For 12 VT Original and Mini Mouse

CREATE A 3D MOVIE IN DIRECTOR

Plotting Spectrum Analyzer Data without a Plotter

ABAQUS/CAE Tutorial: Analysis of an Aluminum Bracket

Introduction To Microsoft Office PowerPoint Bob Booth July 2008 AP-PPT5

Beginners Guide to the TDS 210 and TDS 220 Oscilloscopes

PropScope USB Oscilloscope

AUDACITY SOUND EDITOR SOFTWARE A USER GUIDE FOR AUDIO-VISUAL WORKERS

FreeCapture - A PC remote control program for GDS-800

RX-6 Six In - One Out All in One Receive Antenna Switch Local and Remote Control System RX6ACI User Manual Version 2.1

Power Log PC Application Software

Audacity Sound Editing Software

Creating tables of contents and figures in Word 2013

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

Introduction to the TI-Nspire CX

Adobe Digital Signatures in Adobe Acrobat X Pro

User Guide to LabVIEW & APT

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT BIT DIFFERENTIAL ADC WITH I2C LTC2485 DESCRIPTION

Quickstart for Desktop Version

Microsoft Excel 2013: Charts June 2014

Lecture 2 Mathcad Basics

Excel 2007 Basic knowledge

Workspaces Creating and Opening Pages Creating Ticker Lists Looking up Ticker Symbols Ticker Sync Groups Market Summary Snap Quote Key Statistics

Department of Electrical and Computer Engineering Ben-Gurion University of the Negev. LAB 1 - Introduction to USRP

Transcription:

1. OBJECTIVE LAB II. INTRODUCTION TO LABVIEW In this lab, you are to gain a basic understanding of how LabView operates the lab equipment remotely. 2. OVERVIEW In the procedure of this lab, you will build a virtual instrument (VI) utilizing LabView 2011. This will be accomplished in a flow chart programming environment where you will have to connect control blocks and virtual instruments (VIs) to build another virtual instrument. Specifically you will construct a virtual instrument that will configure the function generator output, program the oscilloscope to measure the output, and display the signal on the screen. Information essential to your understanding of this lab: 1. LabView 2011 Tutorial Materials necessary for this Experiment 1. Standard testing station 3. BACKGROUND INFORMATION LabView is a programming environment that uses a graphical flow chart as the source code. LabView allows us to control the instruments used in the EE 3110 labs. We can control all but one of the instruments in this lab using the IEEE.488 bus. This includes the digital multi-meters, the oscilloscope, the function generator and source meters. In addition to controlling the instruments, LabView allows us to get the information recorded into the computer where we can use a variety of math functions to alter it, fit it, analyze it using statistical functions, plot it on a graph, and store it to a file. These capabilities allow us to focus on the devices being studied, not on the mechanics of taking the measurements. The beauty of LabView is its intuitive graphical environment. Creating VI s is easy because you can think as if you are making an instrument. In the front panel programming window, you can envision all the controls that you want on the front panel of your instrument. As you place them on the front panel, they appear in the block diagram window. Now all you have to do is put in the logic circuits to execute the commands and wire together your controls and your logic functions. It has an extensive library of functions for controlling just about any GPIB (general purpose interface bus) instrument available. This makes controlling and measuring data with the instruments as easy as plunking down a downloaded VI and providing it with the correct inputs and outputs. 4. PREPARATION Please review the online videos for LabVIEW to gain some familiarity with this software before coming to class. 1. Go to the link Introduction to the LabVIEW Platform and watch a general introduction to the LabVIEW software. 2-1

2. Next go to the link The LabVIEW Guided Tour and watch a second demonstration on how to use LabVIEW to take measurements using benchtop instruments. 3. Record a few images from each presentation to a Word document by using Alt Prt Scr in order to verify that you have watched the appropriate videos. 4. Print these images and submit them as your pre-lab work for Lab II. 5. PROCEDURE IN THIS LAB CLASS, DO NOT SAVE YOUR WORK TO THE C DRIVE. Please use your USB key memory only. Introduction to the work environment To create any Virtual Instrument with LabView, we need to work on two windows a block diagram window and a front panel window. The actual components (also called as internal functions) involved in the experiment are arranged in the block diagram window like in a flowchart. The various controls required to operate the components are inserted and arranged in the front panel window. The properties and the values of the various controls are updated in the front panel window. Finally, the controls are linked to the components in the block diagram window and wired suitably and then the design is debugged and then executed. Example problem definition : Construct a VI that can set the function generator s output characteristics, including function (sine, square, triangle, or ramp waves, noise or dc) as well as its amplitude, frequency and offset voltage. Then use the oscilloscope to read the waveform into the computer and plot it in a graph. When you are finished, your front panel window and block diagram window may look something like Figure 1. Figure 1 is only given as an example. You can do the wiring and arrange the controls in any pattern you desire. a.) 2-2

b.) Figure 1. Possible screen shots of the block diagram window (a) and the front panel window (b). 5.1. ACQUIRING THE INTERNAL FUNCTIONS As you recall from the introduction, the internal parts of your VI are always placed directly on the flow chart diagram. Make sure you are in the block diagram window. This is the LabView window with the white background. If your functions pallet is not showing, select the Window menu from the main toolbar in the Diagram window and then select Show Functions Palette. This will make your functions palette appear. Your first task will be to search through the menus of the functions palette in order to, find and place the four instrument drivers needed to build your program. We would be using the oscilloscope and the function generator in this experiment and the various function palettes we would be using to operate these are given below. a.) b.) c.) d.) Figure 2. Functional blocks of the device drivers. Figure 2 a) is the hp 33120a - Select Arbitrary Waveform.vi block or VI. This virtual instrument allows you to configure the function generator to output a certain wave such as a sine wave or a square wave. To find the hp 33120a - Select Arbitrary Waveform.vi driver see Figure 3. "Instrument I/O >> Instrument Drivers" >> "HP33120A VIs" >> "Configure VIs" >> hp 33120a - Select Arbitrary Waveform.vi Figure 3. An example of how to find the hp 33120a - Select Arbitrary Waveform.vi after selecting the Instrument I/0 menu from the Functions Palette. 2-3

Figure 2 b) is the hp 33120a - Config waveform.vi" block. This function block configures all the parameters of the wave initiated by the hp 33120a - Select Arbitrary Waveform.vi block. In other words, the hp 33120a - Config waveform.vi" VI allows you set the duty cycle, amplitude units, DC Offset, Peak Amplitude, and Frequency. It may be found under the Configure VIs menu along with the hp 33120a - Select Arbitrary Waveform.vi block. Figure 2 c) is the "HP546XXX Autoscale.vi" block. This block executes the auto scale function on the oscilloscope. To find the "HP546XXX Autoscale.vi" driver see Figure 4. "Instrument I/O >> "Instrument Drivers" >> "HP546XXX VIs" >> "Configure VIs" >> "HP546XXX Autoscale.vi" Figure 4. An example of how to find the "HP546XXX Autoscale.vi" driver after selecting the Instrument I/0 menu from the Functions Palette. Figure 2 d) is the "HP54600A/610B Read Waveform.vi" block. This block allows LabView to read the wave on a selected channel of the oscilloscope. To find the "HP54600A/610B Read Waveform.vi" block see Figure 5. "Instrument I/O >> "Instrument Drivers" >> "HP546XXX VIs" >> "Data VIs" >> "HP54600A/610B Read Waveform.vi" Figure 5. An example of how to find the "HP54600A/610B Read Waveform.vi" driver after selecting the Instrument I/0 menu from the Functions Palette. Now that you are finished finding the drivers necessary for your virtual instrument, it is time to design your control panel in the Panel window. However you should first take some time to examine the driver blocks. In order to understand what these function palettes signify, we use the context help box to help identify the inputs and outputs of these drivers. If the "Context Help" is not already showing, select Help from the menu from the main toolbar in the Diagram window and then select Show Context Help or press Ctrl-H. After examining each driver for its inputs and outputs, switch to the Panel window. 5.2. BUILDING A CONTROL PANEL Now it is time to program the front panel of your VI. You may either click on the Panel window or press Ctrl-E to bring it to the front. We can observe from Figure 1 that we need four numeric inputs to the waveform generator viz. Frequency, amplitude, duty cycle and DC offset and three ring counters to provide options for the amplitude unit, the type of waveform and the oscilloscope channel to be used. Examine Figure 6 to see an example of how to select these controls. Modern >> Numeric >> Digital Control a) Modern >> Ring & Enum >> Text Ring b) 2-4

Figure 6. The steps to select a numeric control or a ring control from the Controls palette. Before we continue placing controls, it important to know how to edit them. To change the properties of any block, right click on them and a menu will appear with all the available editing options. It will be necessary for you to modify the properties of your numeric controls and ring controllers in order for your VI to function properly. Reference the two pop up menus of a numeric controller (Figure 7 a) and of a ring controller (Figure 7 b). Changing different parameters is as simple as clicking on these items and entering the data. For example, changing the way the computer represents the controller s numbers may be done by moving your mouse over the representation selection in either pop up window causing a second window to appear, providing you the choice of four number formats with three bit lengths. The four formats are signed integers(i), unsigned integers(u), floating point numbers(sgl, DBL, EXT) and complex floating point numbers(csg, CDB, CXT). You will have to do this in the subsequent lab. a) b) Figure 7. The pop up menus of a numeric controller (a) and a ring controller (b). The Data Range, the Format & Precision function, and the Edit Item functions now reside under the item Properties located at the end of each of these menus in LabView 2011. Edit Item is used to edit the ring counter s strings. The different states of the ring counters are visible once you enter this pulldown. Each are associated with a different number given in sequence. Simply click on these states and enter in an appropriate label to define a particular state. The commands Insert, Delete, Move Up, and Move Down located under Edit Item are further used to edit the states of the ring counters. The number of the state of the ring counter must correlate with the number of the state in the VI to which the ring counter is inputting data. Consequently, these state numbers are very important because they provide inputs to the VIs. Later in the lab, you will have to use these commands to label the states of your ring controller. Each state will have a number associated with it based on its location and the starting number of the first state. In Figure 8 below the starting number is one, therefore the following states are two, three, and four in the forward incremented direction. If the starting number was zero, the following states would be one, two, and three in the forward direction. 2-5

1 2 1 2 4 3 4 3 Figure 8. The two directions of a four state ring counter. The solid (red) lines show the current state of the ring counter when an increment is executed. The dotted (blue) lines show the current state of the ring counter when a decrement is executed. During this lab, we will select the state for all three ring counters and then execute the program using these particular states. These states will indicate the type of amplitude unit you will use [V pp (Voltage peak to peak), V rms (Voltage root mean squared), or db (decibel)], the type of waveform you will use [DC, sine, square, triangle, or ramp], and the oscilloscope channel you will use to take the data [channel one or two]. Once you have selected your numeric and ring controllers, find yourself a graph to display your signal. To find the waveform graph follow the instructions of Figure 9. Modern >> Graph >> Waveform Graph Figure 9. The steps to select the waveform graph from the Controls palette. In order for the instrument drivers in LabView to work, they need a VISA (Virtual Instrument Software Architecture) to connect to the physical instruments. A VISA functions as an interface library for controlling and utilizing GPIB, VXI, RS-232 and other instrument protocols. Since we have two physical instruments we will need two VISAs. Follow the instructions of Figure 10. Once your VISAs are added, address each of your VISAs to an instrument. The VISA address for the function generator and oscilloscope is on the equipment. The address used in the software for this equipment is actually an extremely long address which ends in the address given on the equipment plus the term INSTR (e.g.: MY44010181::INSTR). The software will recognize the address associated with each tool. You will only need to use the pulldowns associated with the function generator and the oscilloscope I/O on the Front Panel to select the correct address for these tools. Make sure to enter these addresses or your VI will not run. Modern >> I/O >> VISA Resource Name Figure 10. The steps to select a VISA from the Controls palette. The last set of items you will need on your control panel are the Error In 3D.ctl and Error Out 3D.ctl connections. These blocks ensure that the timing between the instrument drivers is coordinated so that each instrument will operate at the appropriate time. To learn how to find the error controls, consult Figure 11. 2-6

Modern >> Array, Matrix & Cluster >> Error In 3D.ctl a) Modern >> Array, Matrix & Cluster >> Error Out 3D.ctl b) Figure 11. The steps necessary to select the error controls from the Controls palette. Take note of the symbol name for the error in (a) and the error out (b) controls. You now have all the controls necessary for building your VI and the driver blocks to configure and run the instruments. Now it is time to wire together your virtual instrument with the aid of the Context Help window. If the Context Help window is not showing, select Help from the menu from the main toolbar in the Diagram window and then select Show Context Help or press Ctrl-H. 5.3. WIRING THE VI To wire the VI, switch back to the Diagram window or press Ctrl-E on your keyboard. All of the parts you installed on your panel are now present in the diagram window. Proceed to wire them together using the context help window. The context help will inform you of how to wire your block diagram together as well as the important parameters of your controllers. For example, the context help tells you to start the range of the ring counter that controls the waveform input of the hp 33120a - Select Arbitrary Waveform.vi driver at one although the default setting is zero. Rename each block as you connect them to denote their significance. As you do this in the Diagram window, the names will appear on the control panel. In order to wire or name a block you must select the correct icon from the Tools palette (Figure 12). After you are finished wiring together your circuit you are ready to debug. Figure 12. The Tools palette. The finger is used to press buttons, the pointer is used to select areas, the letter is used to change to text, and the spool is used to wire your diagram. 5.4. DEBUGGING THE VI There are a number of errors that LabView automatically detects for you, one of which is broken wires in the Diagram window. If there is an error with your VI there will be a broken arrow under the main tool bar (Figure 13). You may either click it or press Ctrl-R on your keyboard and all the errors known to LabView will be displayed. a.) b.) 2-7

Figure 13. The run icon under the main control toolbar (a) changes to a broken arrow (b) when errors are detected in your VI. Not all errors are detected by LabView, so you may have to revisit your diagram a number of times searching for errors, even if your VI is executable. Remember to use the Context Help window in your debug process to make sure you wired everything right. Do not be afraid to execute your VI in order to find errors. This may require you to switch back and forth from the Diagram window to the Panel window. Do not worry about fixing the errors, which are displayed on the bottom right hand side of the panel window. Simply read them and then come back to them after you have finished with the next section of the procedure. The following are a list of the most common errors students make in this lab: 1. Not connecting the ring counters to the correct inputs of their instrument drivers. The waveform input to the hp 33120a - Select Arbitrary Waveform.vi block must be a ring counter so that you may name each signal sine, square, triangle, etc. The Units input to the hp 33120a - Config waveform.vi" block should be a ring counter since it controls the units of the function generators signal such as Vpp, Vrms, and db. The channel input to the "HP54600A/610B Read Waveform.vi block must be a ring counter so that you may give the channels names. 2. Not setting the proper range for controls. In the previous lab experience, you learned the limits of your physical lab equipment. For example the minimum frequency for the function generator is 100 Hz. If you try to enter a lower value, it will cause an error. As mentioned earlier, the proper range for the ring counter of the hp 33120a - Select Arbitrary Waveform.vi block starts at one. 3. Not modifying the data type of a controller to match the VI block. The Units input to the hp 33120a - Config waveform.vi" block must be an unsigned integer. Unsigned integers are denoted by a U followed by an 8, 16, or 32 denoting the bit size. Once your VI is executable, it is time to enter some values and do a trial run of your VI. 5.5. PREPARING TO PUT YOUR VI TO THE TEST You need to do the following three things: Construct the VI to read the waveforms set in the Function Generator. Obtain a square wave output on Channel 1 of the Oscilloscope with 100 KHz and 3 V RMS. Obtain a Sine wave output on the Channel 2 of the Oscilloscope with 10 KHz and 2 V pp. Connect the function generator to the appropriate oscilloscope channel with the coaxial cable. Turn on the function generator and the oscilloscope. Set the function generator to High Z output impedance and press the output button to the function generator. Make sure to select the Frequency, Amplitude, Duty Cycle (given in percent), and DC offset on the Front Panel. Then select the Amplitude Unit, the Type of Waveform, and the Oscilloscope Channel with the ring counters. Finally select the address for the Function Generator and the Oscilloscope. Press the white arrow in the upper left of the Front Panel to execute the program. Adjust the scale of the horizontal and vertical axis to better fit the output data if necessary. For each set of configurations, you should either print the screen of your VI verifying that your VI works for the given configuration, or if your VI does not work you must be prepared to explain why the parameters given were not valid. To facilitate grading, you will be required to label all of your controllers. In addition, the following strings need to be entered into your ring counters so that the TA will know what controller configuration gave the screen shot that you are turning in. 2-8

Enter the following states into your three ring counters. Each ring counter will then input this data into a specific VI. 1. Amplitude Units: Enter the strings V pp (Voltage peak to peak), V rms (Voltage root mean squared), and db (decibel) in the first ring counter. This ring counter should input the amplitude unit into the Config Waveform VI. These strings must be entered in the same location and order as within the VI. Enter these parameters in the order above starting from state zero to do this. 2. Waveform: Insert DC, sine, square, triangle, and ramp strings at the corresponding places of this ring counter. This ring counter should input the type of waveform into the Select Arbitrary Waveform VI. These strings must be entered in the same location and order as within the VI. Enter these parameters in the order above starting from state zero to do this. 3. Oscilloscope: Label channels one and two. This ring counter should input the channel into the Read Waveform VI. These strings must be entered in the same location and order as within the VI. Enter these parameters in the order above starting from state zero to do this. After entering this data in your ring counters test your VI a number of times to help you debug it. Save your VI and all printed screens to your floppy disk for use in your lab report. 6. LAB REPORT Type a lab report with a cover sheet containing your name, class (including section number), date the lab was performed on, and the date the report is due. Use the following outline to draft your lab report. Summary: type a summary of the key features and advantages of using the LabView. LabView o Insert the screen shot for each configuration. o Write an explanation of your configuration o If your VI did not work, explain why it did not execute for the given parameters. Conclusions: type a summary of the things that you learned from this lab. 2-9