DOC PREVIEW
UCSB ME 104 - LABORATORY

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

INTRODUCTIONPART 1. INTRODUCTION TO LABVIEW 7PART 2. USING LABVIEW WITH DATA ACQUISITION HARDWAREExperiment 2A. Acquire Analog Input VoltageSAVING FILESLABORATORY REPORT ADDITIONAL READING AND PRACTICEPRINTING FRONT PANEL AND BLOCK DIAGRAM OF A LABVIEW VI USING MS WORDCOPYING DATA FROM A TEXT FILE TO A MATLAB M-FILE USING NOTEPAD PLOTTING DATA USING MATLABME 104 Sensors and Actuators Fall 2008 Laboratory 1 Introduction to LabVIEW Department of Mechanical Engineering University of California, Santa Barbara Fall 20082 INTRODUCTION In this laboratory, you will learn how to use the LabVIEW development environment, which is based on the graphical programming language G. You will then write a LabVIEW program to acquire, display, and save an external voltage signal. LabVIEW is a programming language just like other programming languages, such as C, Basic, or Pascal, but LabVIEW is higher–level. In text-based programming languages, you are as concerned about the code as you are about what you are trying to do; you must pay close attention to the syntax (commas, periods, semicolons, square brackets, curly brackets, round brackets, etc.). LabVIEW is much more user-friendly — it uses icons to represent subroutines, and you wire these icons together in order to define the flow of data through your program. It is sort of like flow-charting your code as you are writing it—and the net effect is that you can write your program in a lot less time than if you did it in a text-based programming language.1LabVIEW software and hardware (data acquisition boards) have been installed on the PC’s in the Undergraduate Control Laboratory (Engineering 2, Room 2218). To launch LabVIEW, go to the Windows NT Start menu and proceed as follows: Start >> Programs >> National Instruments LabVIEW 7.1 or Start >> Programs >> National Instruments >> LabVIEW 7.1 >>LabVIEW. LabVIEW software (without data acquisition hardware) is also available in the CADLab (Room 2243). PART 1. INTRODUCTION TO LABVIEW 7 Objective • Become familiar with the LabVIEW environment. • Learn the general approach to building a virtual instrument in LabVIEW. • Build a LabVIEW virtual instrument. Your TA will give an introductory presentation on LabVIEW 7. You will build some simple VIs to become familiar with LabVIEW 1 Paragraph excerpts from LabVIEW—Proven Productivity (April 2000), National Instruments Corporation.3Oscilloscope External voltage PART 2. USING LABVIEW WITH DATA ACQUISITION HARDWARE Objective • To use a VI to acquire an analog voltage via a DAQ(data acquisition) board, plot the voltage to a chart, and write the voltage to a spreadsheet file. • Review the operation of the oscilloscope and the function generator. Experiment 2A. Acquire Analog Input Voltage The hardware configuration for sampling an analog voltage signal is shown in Figure 1. To view a specific analog input, you will connect an external voltage signal to the CB-68LP connector block shown in Figure 2. The connector block is directly connected to the DAQ (data acquisition) board by a 2 meter, shielded I/O (input/output) cable. The Tektronix CFG280 Function Generator is used to generate an external voltage signal, which should be verified on the oscilloscope before connecting to the connector block. Figure 1. Hardware configuration for sampling analog voltage signal. PCDAQ board Connector blockFigure 2. CB-68LP connector block • Safety note: Before you connect an external voltage signal to the connector block, you should always use an oscilloscope to verify that your external voltage signal is well-behaved and has an amplitude of not more than 10 volts. Since the DAQ board is rated for voltages between –10 V and +10 V, application of a voltage outside that range could cause irreparable damage to the (expensive) DAQ circuitry. If you need help using your function generator or oscilloscope, please ask a TA for assistance. 1. Using a BNC connector (Fig. on right) and cable, connect the MAIN OUT terminal on the function generator to your oscilloscope. 2. Turn on the oscilloscope and set its vertical scale to 1.00 volts/division and its horizontal scale to 1.00 seconds/division. 3. On your function generator, select the “MAIN 0-2Vp-p” setting by pressing down that button. This will limit your voltage output to 2 volts, peak-to-peak1. 4. Find the FUNCTION selection buttons on your function generator. Select (press down) the sine wave function (◠◡) button. Make sure that none of the other buttons on that row are pressed down. 5. Turn ON the function generator. 6. Press the down MULTIPLIER ( ∇ ) button until the MULTIPLIER indicator (red light) shows 1 and the PERIOD indictor shows SEC. In this setting, the digital display shows the output period in seconds. 7. Turn the FREQUENCY dial on the function generator until the digital display shows approximately 1.000. This indicates that the function generator is generating a signal with a period of approximately 1 second (and therefore, a frequency of approximately 1 Hz). 1 Therefore, the maximum amplitude will be 1 V. 458. Find the AMPLITUDE knob on the function generator. Turn it clockwise as far as you can to select the maximum (MAX) amplitude of 2V peak-to-peak. 9. Verify on your oscilloscope that the output from your function generator is, in fact, a sine wave with an amplitude of 1 volt and a period of 1 second (frequency of 1 Hz). For safety purposes, please show your output signal to a TA before proceeding to the next step. 10. Connect the analog voltage and analog ground from your function generator to the CB-68LP connector block as shown in Table 1. You should use wires with stripped ends1 to make the indicated connections. Do not remove the connections to the oscilloscope. Table 1: CB-68LP connector block pin assignments for measuring a voltage signal using Analog Input Channel 0. External Signal (from Function Generator) Connect to: Analog voltage (Red probe) Pin 68 (ACH0) Analog ground (Black probe) Pin 672 (AIGND) You are now ready to run your VI. 11. Go to the front panel and run the VI. Your Analog Input Chart should display a voltage signal that appears somewhat distorted due to graphical interpolation effects. 12. When you click on the Stop button, a dialog box will appear as before. Type yourname_lab1_SineWav.txt and Save this to your ECI account. This (long) name indicates that the


View Full Document

UCSB ME 104 - LABORATORY

Download LABORATORY
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view LABORATORY and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view LABORATORY 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?