enge_1104_lab_3_spring_2007_students_copy_v1c

enge_1104_lab_3_spring_2007_students_copy_v1c - EngE 1104...

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

View Full Document Right Arrow Icon
EngE 1104 Spring 2007 Lab 3: Arrays, Clusters (Class Objects), and Sub-VI’s (Subroutines) in LabVIEW Written by: Jeremy Garrett, Edited by: Tom Walker Version 1B. Copyrighted: Jan, 2007 Preparation: No special preparations required. No lab warm-up required for this particular lab. Lab Objective: To use and analyze “case structures” (“if-then-else” commands). To use and analyze manually created array controls and array constants. To use and analyze “clusters” (“class objects”). To modify a student created VI into a “sub-VI” (“sub-routine”). Overview: In nearly all modern programming languages (such as C++ and Java), items called “arrays” and “class objects” are used extensively. In fact, without these methods of organizing data we would not have the word processors in which this document is being read. In this lab we will make and study some small arrays and then graph our data in an “X versus Y” style graph. In order to do that however we will need to “bundle” our two arrays into a “cluster” (in C++ or Java this would be called a “class object”). After creating that first cluster we will create some of our own and we will then convert our “VI” (“VI” stands for “Virtual Instrument” and is LabVIEW’s name for a computer program) into a “sub-VI” (or subroutine). The lab will then conclude by creating a new program which calls and runs our previous VI as a sub-VI. Part 1 – “Case Structures” (LabVIEW’s version of “If – Then” statements): Part 1 – Background: In this part of the lab we will explore LabVIEW’s “case structures,” which are its equivalents to the “if-then-else” commands that are used in most text-based languages. During the process we will also practice creating controls, indicators, and constants. 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 2, Part 1”. Then create
Background image of page 1

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

View Full DocumentRight Arrow Icon
a third comment that contains the name of your instructor, and a fourth that contains the 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
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

enge_1104_lab_3_spring_2007_students_copy_v1c - EngE 1104...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online