Ocampo 08LabExercise
Ocampo 08LabExercise
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 was originally released in 1986 for Apple Macintosh. Using the graphical language "G,"
LabVIEW was designed to interact with virtual instruments in order to take measurements and create
automation. LabVIEW remained a Mac-only product until 1992, when National Instrument released versions
for SunOS and Windows.
LabVIEW remains propriety software, owned and maintained by National Instruments. As such, it
is not required to meet any third-party standards, such as ANSI or ISO, as more common languages are,
sparking some complaints about performance and licensing; however, LabVIEW remains a popular
language for programming and automating the Internet of Things. National Instruments maintains a regular
release cycle, publishing a new major version every August.
National Instruments also develops an enormous inventory of hardware devices which can be
programmed and controlled using LabVIEW, including data acquisition tools such as counters, timers,
sensors, and signal analyzers; test instruments; monitoring hardware; and instrument control devices.
LabVIEW is a graphical programming language designed for interfacing with measurement and
control devices. Using simple, visual code, scientist and engineers can easily collect measurements,
analyze data, and share their results using custom-built applications.
Using only the graphical environment, users can program fully-functioning, complex applications
without knowing a single line of code. Using the built-in compiler, the graphical code is translated directly
into executable machine code and can be ported to multiple platforms.
LabVIEW is a dataflow language, meaning programs are constructed from a set of routines
(represented by graphical images), which are strung together by a series of wires and arrows. Unlike text-
based languages that pass data from function to function using variables, data in a LabVIEW program flows
in the direction of the wires, and routines function directly in response to input. Rather than executing in a
pre-defined order, routines execute once they receive all required input.
4. Resources:
LabVIEW
5. Procedure:
1
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 instructors email address.
2. Open LabVIEW 15 and the Getting Started appears. Click the Blank VI option. The Block
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 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
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 Parallelepiped
c. Sphere
d. Cone
e. Right Circular Cylinder
B.
Table B1. Different Controls Available for the Input of VIs
Name and Icon of the Control Description of the Control
Numeric control is the simplest way to enter numeric
data. You can resize these front panel objects horizontally
to accommodate more digits.
Use the time stamp control to send a time and date value
to the block diagram.
4
Use to display numeric data in a vertical or horizontal
slide with a customizable scale and a pointer that helps
you see the exact value.
5
Multiply
6
Use to show progress in a vertical or horizontal bar.
7
A table is a 2D array of strings. Use the String
functions to manipulate tables.
C. Procedure C
Table C. Front Panel and Block Diagram windows SubVI
for the sum and average of three numerical values
8
D. Procedure D
Table D1.a Front Panel and Block Diagram windows
for the area and perimeter of a Square
9
Table D1.c Front Panel and Block Diagram windows
for the area and circumference of a Circle
10
Table D2.b Front Panel and Block Diagram windows
for the area and perimeter of a Rectangular Parallelipiped
11
Table D2.e Front Panel and Block Diagram windows
for the area and perimeter of a Right Circular Cylinder
7.Conclusion:
I therefore conclude that using LabVIEW I was to explore the software and its functions as well. Even
though it is for programmers mainly ECE and CpE, as a Chemical Engineer in the future, knowledge in
such software that other programs are using is a great edge for me as I pursue jobs. It is just like Matlabs
Simulink but they have different functions.
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.
13