You are on page 1of 19

JULY 2017 LAB 1

UNIVERSITI KUALA LUMPUR


MALAYSIAN INSTITUTE OF INDUSTRIAL TECHNOLOGY

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)

SEMESTER : JULY 2017

SUBJECT CODE : JCB 30304

SUBJECT TITLE : DATA ACQUISITION SYSTEM

SUBMISSION DATE : 13 / 8 / 2017

NAME : NOR AZIMAH BINTI ABDUL AZIZ

STUDENT ID : 57214115143

LECTURER’S NAME : MISS NUR FAZIRA BINTI HARIS

SUBMISSION DATE : 13 /8 /2017

JCB 30304 DATA ACQUISITION SYSTEM Page 1 of


19
JULY 2017 LAB 1

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

JCB 30304 DATA ACQUISITION SYSTEM Page 2 of


19
JULY 2017 LAB 1

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

JCB 30304 DATA ACQUISITION SYSTEM Page 3 of


19
JULY 2017 LAB 1

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

JCB 30304 DATA ACQUISITION SYSTEM Page 4 of


19
JULY 2017 LAB 1

Block diagram

When x = 0, 0^2= 0 and sqrt(0) = 0

Situation x<0

Front panel

JCB 30304 DATA ACQUISITION SYSTEM Page 5 of


19
JULY 2017 LAB 1

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

Run the VI and discuss the solution of the equation in LabVIEW.

a.

JCB 30304 DATA ACQUISITION SYSTEM Page 6 of


19
JULY 2017 LAB 1

b.

JCB 30304 DATA ACQUISITION SYSTEM Page 7 of


19
JULY 2017 LAB 1

For equation 4AC > B^2

JCB 30304 DATA ACQUISITION SYSTEM Page 8 of


19
JULY 2017 LAB 1

JCB 30304 DATA ACQUISITION SYSTEM Page 9 of


19
JULY 2017 LAB 1

Figure 2 Example Front Panel

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).

Figure 3 Converting binary switch settings to a decimal value

The math is simpler than the explanation:


Where A,B, and C each have values of 0 or 1 depending on whether the switch is open or
closed.
a. Create a VI similar to the front panel shown in Figure 4, and use it to
determine the decimal value equivalent to the following binary numbers:
i. 001 (C is off, B is off,A is on)

JCB 30304 DATA ACQUISITION SYSTEM Page 10 of


19
JULY 2017 LAB 1

ii. 010

JCB 30304 DATA ACQUISITION SYSTEM Page 11 of


19
JULY 2017 LAB 1

iii. 101

JCB 30304 DATA ACQUISITION SYSTEM Page 12 of


19
JULY 2017 LAB 1

b. Modify your VI to handle four-bit binary numbers by adding another switch.

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

JCB 30304 DATA ACQUISITION SYSTEM Page 13 of


19
JULY 2017 LAB 1

JCB 30304 DATA ACQUISITION SYSTEM Page 14 of


19
JULY 2017 LAB 1

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

JCB 30304 DATA ACQUISITION SYSTEM Page 15 of


19
JULY 2017 LAB 1

Block diagram

Temperature using Van der Waal's equation


Front panel

Block diagram

JCB 30304 DATA ACQUISITION SYSTEM Page 16 of


19
JULY 2017 LAB 1

(ii) By using Express Formula icon recreate the VI.


Temperature using ideal gas law
Front panel

Block diagram

JCB 30304 DATA ACQUISITION SYSTEM Page 17 of


19
JULY 2017 LAB 1

Temperature using Van der Waal's equation


Front panel

JCB 30304 DATA ACQUISITION SYSTEM Page 18 of


19
JULY 2017 LAB 1

JCB 30304 DATA ACQUISITION SYSTEM Page 19 of


19

You might also like