Instrumentation Lab # 01: Introduction To Labview (General)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Instrumentation Lab # 01

Name: -

Roll #:-

Section: -

Date:-

Introduction To LabView (General)


Data Types:
There are various data types in LabView such as Double, Integer, Boolean, Strings, Arrays, and Clusters
etc. These can be defined in LabView as follows.

Task # 01:
Make a VI which will take two Strings as an input; your First
Name and Last Name, Find out the length of each string,
concatenate them and also calculate the length of your
complete Name.

Solution:

Case Structures:
It is used for IF else statement in a LabView or used as a Switch.
For example, we make a program that will perform Addition when Boolean Switch is ON, and perform
Subtraction when Switch in OFF.

Task # 02:
In the above program, we just have 2 options, True and False, Amend the above program for four cases
and replace the Boolean Switch with a Numeric Switch. When user enters 0, it will perform Addition, for
1, Subtraction, for 2, Multiplication and for 3, Division.

Solution:-

Loops:
There are 2 types of Loops in LabView; For Loop and While Loop
For loop is used to iterate the program up to a specific number, for example if you want to run the
program for 5 times, you can fix the value of iterations up to 5 as follows.

The above program will stop when N


equal to 5. The initial value of i is 0. It
is incremented each time until i=5. So the final answer would be 5 as loop has completed its 5 iteration
from 0 to 4.
While Loop:-

In LabView, a while loop acts as do while. The program runs always one time and then depends on the
condition. For example, we make a while loop that should stop when i = 5 as follows.

Task # 03:
Make a VI that will display Odd Numbers starting from 3 and waits for 2 seconds after each next output.
The program should stop until a STOP Button is pressed by the User.
Solution: - Since Odd numbers can be written as 2x+1, so following program will perform the required
task.

You might also like