Professional Documents
Culture Documents
LAB 1
INTRODUCTION TO LABVIEW
Demonstrate solutions with LabVIEW application that related to the real world problems.
(P3)
Show how to debug a visual programs design using LabVIEW with readability and future
development with ability to establish effective reports, documentation, presentations.
(P3)
STUDENT ID : 57214115143
INTRODUCTION
LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical programming
language that uses icons instead of lines of text to create applications. In contrast to text-based
programming languages, where instructions determine the order of program execution, LabVIEW
uses dataflow programming, where the flow of data through the nodes on the block diagram
determines the execution order of the VIs and functions.
VIs, or virtual instruments, are LabVIEW programs that imitate physical instruments.
In LabVIEW, you build a user interface by using a set of tools and objects. The user interface is
known as the front panel. You then add code using graphical representations of functions to control
the front panel objects.
This graphical source code is also known as G code or block diagram code. The block diagram
contains this code. In some ways, the block diagram resembles a flowchart.
OBJECTIVES
Understand and practice using the front panel, block diagram, and icon/connector
Learn the difference between controls and indicators
Be able to recognize the difference between the block diagram terminals of controls and
indicators
Understand the principle of dataflow programming
Become familiar with LabVIEW menus, both pop-up and pull-down
Learn about the capabilities and uses of the Toolbar, Tools palette, Controls palette,
Functions palette, and subpalettes
SELF ASESSMENT
1. The Getting Started window is designed to provide quick access to useful things. Determine
the “things” can you access from the Getting Started window?
-search LABVIEW
-Open a new VI
-Create a new project
-Access LabVIEW help
Find and open an existing VI
Recent Vis
Access internet resources
2. The mouse icon looks like a spool while wiring terminals together on the block diagram.
Describe how do you get the mouse icon to look like a spool? (i.e., how do you get LabVIEW
into “wiring” mode?)
Move the mouse to the terminal by using tools palette
3. When numeric controls are placed on the front panel, the increment/decrement buttons are
displayed by default. In which way, do you hide the increment/decrement buttons?
To hide increment button, right click and choose visible item and hide the increment
/decrement button
4. With dataflow programming, when is a function evaluated and the function’s result calculated?
Block diagram executes dependent on the flow of data; block diagram does NOT
execute left to right
Node executes when data is available to ALL input terminals
Nodes supply data to all output terminals when done
LABWORK
1. Divide two numbers and glow an LED if the result of the division is infinity (i.e. the divisor is
zero).
Draw the Front Panel and Block Diagram,
Front panel
Block diagram
2. Use LabVIEW’s Square and Square Root functions to create a VI (similar to the VI shown in
Figure 1) that will accept a value, compute the square of the value and the square root of the
value, and display the results.
Figure 1
Draw the Front Panel and the Block Diagram. Discuss the situation when X = 0 and X < 0.
Situation when X= 0
front panel
Block diagram
Situation x<0
Front panel
Block diagram
When x<0 which is x =-2, (-2)^2 = 4 and sqrt (-2) = NaN because negative numbers do not
have real square root since a square is either positive or 0.
3. Write a quadratic equation solver that will accept values for A, B, and C, defined by
B B 2 4 AC
x
2A .
Test your VI with the coefficients shown in Figure 2 below. When it is working solve the
following quadratic equations:
a.2 x 2 2 x 4 0
b. x 2 1.7 x 4.8 0
When 4AC B
2
, there is a negative number inside the square root operator. This is the
case for equation such as 2 x 2 x 0 .
2
a.
b.
4. LabVIEW provides a function that converts a Boolean (True, False) value into a 1 or 0.The
function is available in the Mathematics Group:
That function can be used to convert a switch position to a zero or one, which makes it
possible to calculate the digital value of a set of three switches (see Figure 3) used to set a
three-bit binary value (101 in Figure 4).
ii. 010
iii. 101
5. Figure 5 below show the Front Panel of conversion from time in seconds and breakdown the
input into separate indicators. Your task is to converts seconds into hours, minutes, and
seconds. In addition, alert users with LED and message if time exceeds 1 hour.
Figure 4 Question 5
6. The ideal gas law was introduced, whereby its describes the relationship between pressure
(P), temperature (T), volume (V), and the number of moles of gas (n).
PV nRT
The additional symbol, R, represents the ideal gas constant. The ideal gas law is a good
approximation of the behaviour of gases when the pressure is low and the temperature is
high. (What constitutes low pressure and high temperature varies with different gases.) In
1873, Johannes Diderik van der Waals proposed a modified version of the ideal gas law.
n2 a
P 2 V nb nRT
V
In this equation the additional variables a and b represent values characteristic of individual
gases. Use both the ideal gas law and van der Waals’ equation to calculate the temperature
of water vapour (steam).
The data is given in Table 1.
Table 1: Data For Question 6
Pressure, P 220 bar
Moles, n 2 mol
Volume, V 1L
a 5.536 L2bar/mol2
b 0.03049 L/mol
Ideal gas constant 0.08314472 L bar/K mol
(i) Create a VI (Front Panel and Block Diagram) to find the temperature using the ideal gas
law and using Van der Waal's equation. Show your answer on the Front Panel.
Temperature using ideal gas law
Front panel
Block diagram
Block diagram
Block diagram