LabExercise 8 - LabVIEW Exploration
LabExercise 8 - LabVIEW Exploration
8
LabVIEW Exploration and the Design of Systems Through Virtual Instruments (VIs)
1. Objective:
The activity aims to explore the use of Laboratory Virtual Instrumentation Engineering Workbench and
design Virtual instruments,Vis.
2. Intended Learning Outcomes (ILOs):
The students shall be able to:
2.1 Learn the different controls, functions and indicators available for the Input, Process and Output of
a LabVIEW graphical program called virtual instruments (Vis).
2.2 Build a simple .vi file for the sum and average of three numerical values using numeric controls
(Input), add and divide functions (Process), and numeric indicator (Output).
2.3 Create sub-VIs and use this concept in the development of a more complicated system.
3. Discussion:
LabVIEW offers more flexibility than standard laboratory instruments because it is software-based.
You, not the instrument manufacturer, define instrument functionality. Your computer, plug-in
hardware, and LabVIEW comprise a completely configurable virtual instrument to accomplish your
tasks. Using LabVIEW, you can create exactly the type of virtual instrument you need, when you
need it, at a fraction of the cost of traditional instruments. When your needs change, you can modify
your virtual instrument in moments.
LabVIEW tries to make your life as hassle-free as possible. It has extensive libraries of functions and
subroutines to help you with most programming tasks, without the fuss of pointers, memory
allocation, and other arcane programming problems found in conventional programming languages.
LabVIEW also contains application-specific libraries of code for data acquisition (DAQ), General
Purpose Interface Bus (GPIB), and serial instrument control, data analysis, data presentation, data
storage, and communication over the Internet. The Analysis Library contains a multitude of useful
functions, including signal generation, signal processing, filters, windows, statistics, regression, linear
algebra, and array arithmetic.
A LabVIEW program consists of one or more virtual instruments (VIs). Virtual instruments are
called such because their appearance and operation often imitate actual physical instruments.
1
However, behind the scenes, they are analogous to main programs, functions, and subroutines from
popular programming languages like C or Basic. Hereafter, we will refer to a LabVIEW program as a
"VI" (pronounced "vee eye," NOT the Roman numeral six, as we've heard some people say). Also,
be aware that a LabVIEW program is always called a VI, whether its appearance or function relates
to an actual instrument or not.
A VI has three main parts: a front panel, a block diagram, and an icon.
1. The front panel is the interactive user interface of a VI, so named because it simulates the front
panel of a physical instrument (see Figure 1.4). The front panel can contain knobs, push
buttons, graphs, and many other controls (which are user inputs) and indicators (which are
program outputs). You can input data using a mouse and keyboard, and then view the results
produced by your program on the screen.
2. The block diagram is the VI's source code, constructed in LabVIEW's graphical programming
language, G (see Figure 1.5). The block diagram is the actual executable program. The
components of a block diagram are lower-level VIs, built-in functions, constants, and program
execution control structures. You draw wires to connect the appropriate objects together to
define the flow of data between them. Front panel objects have corresponding terminals on the
block diagram so data can pass from the user to the program and back to the user.
3. In order to use a VI as a subroutine in the block diagram of another VI, it must have an iconwith
a connector (see Figure 1.6). A VI that is used within another VI is called a subVI and is
analogous to a subroutine. The icon is a VI's pictorial representation and is used as an object in
the block diagram of another VI. A VI's connector is the mechanism used to wire data into the VI
from other block diagrams when the VI is used as a subVI. Much like parameters of a
subroutine, the connector defines the inputs and outputs of the VI.
Virtual instruments are hierarchical and modular. You can use them as top-level programs or
subprograms. With this architecture, LabVIEW promotes the concept of modular programming. First,
you divide an application into a series of simple subtasks. Next, you build a VI to accomplish each
subtask and then combine those VIs on a top-level block diagram to complete the larger task.
4. Resources:
LabVIEW
5. Procedure:
A. Input, process and output of a simple graphical program involving the sum and average
of three numerical values
1. Create a folder with a name Maranan_yourSurnameLabExer09 and place it on the desktop.
All your files must be saved here. Before the end of the period, the contents of this folder
must be sent to your email address and also to your instructor’s email address.
2. Open LabVIEW 15 and the Getting Started appears. Click the Blank VI option. The Block
2
Diagram and Front Panel windows should appear.
3. Click View of the Front Panel window and choose Controls Palette, Express, Numeric
Control. Click Num Control and drop into the Front Panel window. Observe what happens in
the Block Diagram window. Change its label from numeric to x. Add two (2) more Num Ctrl
and label them as y and z (place them below one another). These x, y and z numeric
controls form part of the Input (these controls have arrow pointing outward indicating that
the data they hold serve as an input to another). Add two numeric indicators ( place them
on the right side , one on top of another) and label them as SUM and AVERAGE. The SUM
and AVERAGE numeric indicators form part of the output (these controls have arrow
pointing inward indicating that they accept data from an input).
4. Click View of the Block Diagram window and choose Function Pallete, each of which
performs a certain function and has input and output connectors. Place an ADD function in
between the input and output controls. Place also a DIVIDE function below the ADD
function. Right click each of these functions and select Visible Items, then checking the
Label option. Establish the flow of data by wiring the x, y and z to the ADD function and
then wire the output of the ADD function to the SUM indicator. Wire the output of the ADD
function to the DIVIDE function. Right click the other input of the Divide function and choose
Create < Constant. Type the number 3 when the constant node appears. Wire the output of
the Divide function to the AVERAGE indicator. Click Clean Up Diagram icon and observe
what happens. Note: While the FP window is within your view, you may use CTRL E to
view BD window.
5. Save the file as yourSurnameProcedureA and place it inside the
Maranan_yourSurnameLabExer09 folder . Provide the values of the x, y and z numeric
controls through Front Panel window and click Run. Show the output of Procedure A in
Table A.
B. Different Controls, Functions and Indicators for the Input, Process, and Output of a
LabVIEW program.
1. Determine the different controls available for the Input of a VI. Show the output of
Procedure B.1 in Table B1. Hint: Place a control in FP window, press CTL H and Hover the
control for the description.
2. Determine the different functions available for the Process of a VI. Show the output of
Procedure B.2 in Table B2. Hint: Place a function in BD window, press CTL H and Hover
the function for the description.
3. Determine the different indicators available for the Output of a VI. Show the output of
Procedure B.3 in Table B3. Hint: Place an indicator in FP window, press CTL H and Hover
the indicator for the description.
C. Creating yourSurnameProcedureA.vi as a VI that is used in higher-level VI ( called subVI)
1. Right click the icon at the top-right corner of the Front Panel window and select Show
connector to display the connector pane. Right click this connector pane and choose
3
Patterns. Choose the connector pane pattern having three inputs (3 blank rows in the first
column) and two outputs ( 2 blank rows in the second column).
2. To assign the first row first column slot of the connector plane to the numeric control x, click
the slot on the first row first column of the connector pane and click the numeric control with
a label x. To assign the second row first column slot of the connector plane to the numeric
control y, click the slot on the second row first column of the connector pane and click the
numeric control with a label y. To assign the third row first column slot of the connector
plane to the numeric control z, click the slot on the third row first column of the connector
pane and click the numeric control with a label z.
3. To assign the first row second column slot of the connector plane to the numeric indicator
SUM, click the slot on the first row second column of the connector pane and click the
numeric indicator with a label SUM. To assign the second row second column slot of the
connector pane to the numeric indicator AVERAGE, click the slot on the second row
second column of the connector pane and click the numeric indicator with a label
AVERAGE.
4. To explicitly identify the subVI icon, double click this icon and Icon Editor window appears.
In Line 1 text, type SUM. In Line 2 text, type & . In Line 3 text, type AVERAGE. Then, click
OK.
5. Save the changes you made. Show the Front Panel and Block Diagram windows using
Table C.
D. Creating Vis for Plane and Solid Figures
1. Create a virtual instrument for the computation of area and perimeter of each of the
following plane figures:
a. Square
b. Rectangle
c. Circle
d. Right Triangle
e. Regular Pentagon
Show the output in Procedure D1
2. Create a virtual instrument for the computation of volume and surface area of each of the
following:
a. Cube
b. Rectangular Parallelipiped
c. Sphere
d. Cone
e. Right Circular Cylinder
4
Course: CHE 508 Computer Applications in ChE Laboratory Exercise No.: 8
Group No.: N/A Section: CH51FC1
Group Members: Date Performed: August 16, 2017
Percil, Queenie Rose I. Date Submitted: August 23, 2017
Instructor:
Engr. Crispulo Maranan
6. Data and Results:
A.
Table A. Front Panel and Block Diagram windows of the Simple LabVIEW graphical program
(VI) involving sum and average of three numerical values
5
B.
Table B1. Different Controls Available for the Input of VIs
Name and Icon of the Control Description of the Control
Time Stamps
Fill Slides
Pointer Slides
6
Use to enter or display numeric data in a rotary
action.
Scrollbars
Waveforms
Buttons
Radio Buttons.
8
The digital data control displays digital data arranged
in rows and columns as a digital table. Use the
digital data control to build digital waveforms or to
display digital data extracted from a digital
waveform. Wire the digital waveform data control to
a digital data indicator to view the samples and
Digital Data Control signals of a digital waveform.
9
Subtracts 1 from the input value.
Decrement
10
Use to show progress in a vertical or horizontal
bar.
Progress Bars
Graduated Bars
11
Use to display numeric data with colors. As the
input value changes, the display changes to a
previously chosen color for the value.
Color Ramps
Table
Waveform Chart
12
The XY graph is a general-purpose, Cartesian
graphing object that plots multivalued
functions, such as circular shapes or
waveforms with a varying time base. The XY
graph displays any set of points, evenly
sampled or not.
XY Graph
C. Procedure C
Table C. Front Panel and Block Diagram windows SubVI
for the sum and average of three numerical values
D. Procedure D
Table D1.a Front Panel and Block Diagram windows
for the area and perimeter of a Square
13
Table D1.b Front Panel and Block Diagram windows
for the area and perimeter of a Rectangle
Front Panel Window
14
Block Diagram Window
15
Table D1.e Front Panel and Block Diagram windows
for the area and perimeter of a Pentagon
Front Panel Window
16
Block Diagram Window
17
Table D2.c Front Panel and Block Diagram windows
for the area and perimeter of a Sphere
Front Panel Window
18
Block Diagram Window
19
7.Conclusion:
I therefore conclude that in this exercise, I was able to explore the use of Laboratory Virtual
Instrumentation Engineering Workbench and design Virtual instruments,Vis. Aside from that, I was able
to learn the different controls, functions and indicators available for the Input, Process and Output of a
LabVIEW graphical program called virtual instruments (Vis), build a simple .vi file for the sum and
average of three numerical values using numeric controls, add and divide functions, and numeric
indicator, and even create sub-VIs and use this concept in the development of a more complicated
system. That is I was able to apply the LabView basics in solving the perimeter and area of a specific
plane and solid figure.
8. Further Readings:
Seborg Dale E., Edgar, Thomas F., and Mellichamp Duncan A. (2004). Process Dynamics and
Control. Singapore: Wiley.
Knopf, F. C. (2012). Modeling, analysis and optimization of process and energy systems.Hoboken,
New Jersey: John Wiley and Sons.
Velten, K. (2009). Mathematical modeling and simulation: introduction for scientists and engineers.
Singapore: Wiley-VCH.
20
9. Assessment (Rubric for Laboratory Performance):
TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES
RUBRIC FOR MODERN TOOL USAGE
(Engineering Programs)
Student Outcome (e): Use the techniques, skills, and modern engineering tools necessary for engineering
practice in complex engineering activities.
Program: Chemical Engineering Course: CHE 506 Section: _______ ____Sem SY ________
Performance Unsatisfactory Developing Satisfactory Very Satisfactory Score
Indicators 1 2 3 4
1. Apply Fails to identify Identifies Identifies modern Recognizes the
appropriate any modern modern techniques and is benefits and
techniques, techniques to techniques but able to apply these constraints of
skills, and perform fails to apply in performing modern engineering
modern tools discipline- these in discipline-specific tools and shows
to perform a specific performing engineering task. intention to apply
discipline- engineering discipline- them for
specific task. specific engineering
engineering engineering practice.
task. task.
2. Demonstrate Fails to apply Attempts to Shows ability to Shows ability to
skills in any modern apply modern apply fundamental apply the most
applying tools to solve tools but has procedures in appropriate and
different engineering difficulties to using modern tools effective modern
techniques problems. solve when solving tools to solve
and modern engineering engineering engineering
tools to solve problems. problems. problems.
engineering
problems.
3. Recognize Does not Recognizes Recognizes the Recognizes the
the benefits recognize the some benefits benefits and need for benefits
and benefits and and constraints constraints of and constraints of
constraints of constraints of of modern modern modern engineering
modern modern engineering engineering tools tools and makes
engineering engineering tools. and shows good use of them
tools. tools. intention to apply for engineering
them for practice.
engineering
practice.
Total Score
Mean Score = (Total Score / 3)
Percentage Rating = (Total Score / 12) x 100%
Evaluated by: Engr. Crispulo G. Maranan June 31, 2017
Printed Name and Signature of Faculty Member Date
21