{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

EngE_1104_Lab_4_Spring_2007_Students_Copy_V1C

# EngE_1104_Lab_4_Spring_2007_Students_Copy_V1C - EngE 1104...

This preview shows pages 1–3. Sign up to view the full content.

EngE 1104 Spring 2007 Lab 4: Arrays, Loops, and More In LabVIEW Written by Jeremy Garrett, Edited by Tom Walker, Copyrighted Jan, 2007 Preparation: No lab warm-up required for this particular lab. Download “Play_Sound_JG_V2A.vi” and “Pause.vi” from Blackboard and copy them to the folder in which you will create / save / execute your own LabVIEW VI’s. Lab Objectives: To use “for loops” and to control the number of times the loop will run. To use “while loops” and to control the number of times the loop will run. To use a loop to create/fill an array Overview: As stated in the previous lab’s overview, arrays are critical ways of storing data, and as a result, this lab will include a further study of arrays. In order to create, fill, and process those arrays two kinds of loops can be used, and it is these loops that will be the primary focus of this lab. The first type that we will study is the “for loop.” The second type which we will study is the “while loop.” (It should be noted, that although some languages do support types of loops other than just these two (such as the “do while loop”), those few other types are actually just simple variations on these two basic types.) During the last part of this lab, we will use a while loop to create and fill an array with the output of a sine wave equation, and then we will feed that data to a sub-VI (which was written by the author of this lab) that scales the data, sends it to the sound card, and then asks the sound card to use that data to rapidly reposition our computer speakers – in other words, we will use the loop to calculate a set of numbers which we will convert into a sound that we can listen to. Part 1 – “For Loops”: Part 1 – Background: In this part of the lab we will explore the “for loop” command. Part 1 – Procedure: Open LabVIEW and create a blank VI. Before continuing further, switch to the text mouse tool, then click in the upper middle of your block diagram, this will create a “comment.” In the text input that appears type in your name. Then repeat this to add a comment that contains “Lab 4, Part 1”. Then create a third comment that contains the name of your instructor, and a fourth that contains the

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
day and time that your lab meets at. (If you are in an online course, put “online” for your day and time.) (If you want, you may change the font and font size.) Now switch to your front panel and repeat the previous step in order to create the four important comments. Save your new VI (“virtual instrument,” which is LabVIEW’s name for a computer program) and give it meaningful name. Please save your file by first selecting, or making, a special place for your files (such as “c:\My_LabView_Files\Lab_1” (with a unique folder for each lab)) and using the file name “ YourName _Lab1” (where “ YourName ” is obviously replaced with your actual name). (In the following example images, a version number was also added to the end of the
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

EngE_1104_Lab_4_Spring_2007_Students_Copy_V1C - EngE 1104...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online