You are on page 1of 7

Lab Handout #5: Project Design (Creating VI and SubVI)

Instructor: Engr. Veer Bhan


Name: UNSA JAN
CMS ID: 033-19-0048
Department of Electrical Engineering
ELE-321: Linear Control Systems for BE-VI, Spring 2022
Rubrics for Marks Breakdown
Report Structure and
Methods, Results & Formatting, Figures and Total (Out of 10)
Discussion Captioning
70 % 30 % 100 %

Instructions:
1. The lab report has to be uploaded on the LMS (in pdf format) within a week.
2. Each lab report should have a title. Whereas, each task should be properly numbered and
have method, results, and discussion sections.
3. Appropriate picture of the block diagram or both with text (of suitable length) should be
used in the methods section.
4. Pictures (e.g., front panel or the hardware or both), tables, and graphs with appropriate
text should be used in the results section.
5. Discussion section only be used when deemed necessary, like explaination of results.
Rubrics for Lab Reports
S. Criteria Beginning Developing Competent Outstanding
No. (40%) (60%) (80%) (100 %)

1. Methods, The student has Partial/incomplete A major portion of Methods have been
Results, and used incorrect methods, results, the methods, clearly outlined,
Discussion methods, provided their interpretation, results, important trends and
incorrect results, or interpretations, or data comparisons have
(70%) their interpretation, comments/discussi comments/discussi been interpreted
or on has provided by on has been correctly and
comments/discussi the student. provided. However, discussed, a good
on. This indicates a the section can be understanding of
lack of further improved results is conveyed
understanding. by putting more along with good
information. discussion.
2. Report Figures, tables, Figures, graphs, The figure, tables, Figures, tables, and/or
Structure and/or graphs were and/or tables were and/or graphs were graphs were nicely
(30%) poorly (i.e., blurry, fine but contained good looking and presented with
no captions, no errors. The overall the overall report complete captions and
figure number) format was broken format was good the format was
constructed and and contained but still need some amazing.
contained errors. grammatical and improvements.
The overall format contextual errors.
was out of order,
contained many
grammatical and
contextual errors.
Learning Outcomes
After completing this lab session, you should be able to design and create a simple project in
LabVIEW.
You should know about building a front panel and block diagram.

Introduction
Project Planning and Design: Create a list of tasks that users need to perform. Determine the
user interface components (i.e., number and type of controls and indicators) for data analysis,
displaying results, and so on. Divide your application into logical pieces of manageable size.
Begin with a high-level block diagram that includes the main components of your application.
Then, design the subVIs that make up the main components of the high-level block diagram.
SubVIs make the high-level block diagram easy to read, debug, modify, understand, and
maintain. SubVIs can be created for frequent operations, and reuse.
VI Templates include the subVIs, functions, structures, and front panel objects you need to get
started building common measurement applications.If you use a VI template as a subVI,
LabVIEW prompts you to save the template as a VI.
SubVI is a VI that is called from the block diagram of another VI. The controls and indicators of
a subVI receive data from and return data to the block diagram of the calling VI. Click the Select
a VI icon on the Functions palette, navigate to, and place the VI on a block diagram to create a
subVI call to that VI. Generally, the subVI runs without displaying its front panel. If you want a
single instance of the subVI to display its front panel when called, right-click the subVI icon and
select SubVI Node Setup from the shortcut menu. If you want every instance of the subVI to
display its front panel when called, select File»VI Properties, select Window Appearance from
the Category pull-down menu, and click the Customize button.
To use a VI as a subVI, you need to build a connector pane, that is a set of terminals that
corresponds to the controls and indicators of that VI. Define connections by assigning a front
panel control or indicator to each of the connector pane terminals. To define a connector pane,
right-click the icon in the upper right corner of the front panel window and select
ShowConnector from the shortcut menu to display the connector pane. Each rectangle on the
connector pane represents a terminal. The connector pane has, at most, 28 terminals. If front
panel contains more than 28 controls and indicators, group some of them into a cluster and
assign the cluster to a terminal on the connector pane.
To designate which inputs and outputs are required, recommended, and optional, right-click a
terminal in the connector pane and select This Connection Is from the shortcut menu. A
checkmark indicates the terminal setting. Select Required, Recommended, or Optional.
Every VI displays an icon, that is a graphical representation of a VI. It can contain text, images,
or a combination of both. The default icon contains a number that indicates how many new VIs
you
have opened since launching LabVIEW. Create custom icons to replace the default icon by right-
clicking the icon in the upper right corner of the front panel or block diagram and selecting Edit
Icon from the shortcut menu or by double-clicking the icon in the upper right corner of the front
panel. You also can drag a graphic from anywhere in your file system and drop it in the upper
right corner of the front panel or block diagram. LabVIEW converts the graphic to a 32 ×32
pixel icon.
Creating SubVIs from Sections of a VI: Convert a section of a VI into a subVI by using the
Positioning tool to select the section of the block diagram you want to reuse and select
Edit»CreateSubVI. An icon for the new subVI replaces the selected section of the block diagram.
LabVIEW creates controls and indicators for the new subVI and wires the subVI to the existing
wires. Creating a subVI from a selection is convenient but still requires careful planning to create
a logical hierarchy of VIs. Consider which objects to
include in the selection and avoid changing the functionality of the resulting VI.
Designing SubVIs: If users do not need to view the front panel of a subVI, you can spend less
time on its appearance, including colors and fonts. However, front panel organization is still
important because you might need to view the front panel while you debug the VI. Place the
controls and indicators as they appear in the connector pane. Place the controls on the left of the
front panel and the indicators on the right. Place the error in clusters on the lower left of the front
panel and the error out clusters on the lower right.
Use names like Cancel, Reset, and Initialize that describe the action taken.
Viewing the Hierarchy of VIs: The Hierarchy window displays a graphical representation of
the calling hierarchy for all VIs in memory, including type definitions and global variables.
Select Browse»Show VI Hierarchy to display the Hierarchy window. Use this window to view
the subVIs and other nodes that make up the current VI.
Progrommatically calling SubVIs: Perform the following steps in an event structure. (1) Opens
a reference to a VI to load a SubVI. (2) Invoke the method on the main VI. (3) Run the SubVI
and then close the reference.

Tasks

1. What happens when you don’t connect required input terminal.

Here we observed that, when we do not connect required wires we see it gives error as shown in
figure.
2. How a VI would behave if its recommended and optional terminal inputs and outputs
are not wired?

Here we observed that, when we do not connect recommended and optional wires we see it
does not give any error as shown in figure.

3. How the labels of required, recommended, and optional terminals appear appear in the
Context Help window.
By pressing short-cut key ctrl+h we find a window appeared that shows the labels of required,
recommended, and optional wires.

Required wires: Orange-bold wires are called as required connection.

Recommended wire: Orange-thin wire is called as recommended connection.

Optional wire: The green colored wire is said as optional connection

4. Write your observations when you click the Hide Optional Terminals and Full Path
button in the Context Help window.

When we click the Hide Optional Terminals and Full Path button in the Context Help Window
we see that it shows the complete path of the file.

5. Write a program for a calculator, using the concept of subVIs, to perform addition,
subtraction, multiplication, and division.
In above diagram there are four subVIs in which there every subVi performs particular
task.like,addistion SubVI will add two number,SubVI Substraction will substract one number
from another, multiplication subVI will multiply two number and SubVI Division will divide
the two numbers.

You might also like