20331A0449 Week1

You might also like

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

WEEK-1 20331A0449

1)Convert temperature from Celsius to Fahrenheit


Aim: To create a VI that converts temperature reading from Celsius to Fahrenheit
Procedure:
 For converting Celsius to Fahrenheit,
℉= (℃ × 1.8 ) +32
 Open LabVIEW and click on file and new vi.
 Tile the two windows i.e., the front panel and the block panel using ctrl+t.

BLOCK DIAGRAM WINDOW:


 So, it requires one input, two constants and one output, and two functions.
 Right clickNumericMultiply.
 Create two controls: Right click on the inputs side of the MultiplyCreatecontrolrename it as C. For
the other input CreateConstanttype 1.8
 At the output the output side of Multiply, right clickNumericSelect Add block.
 For the other input of Add block CreateConstanttype 32.
 Create an indicator for the Add block: Right clickcreateindicatorrename as F.
 Select all Right clickOff the View as Icons
 From the tools palette, click brush icon for minimizing the block diagram.
FRONT PANEL WINDOW:
 Select the controls and indicators, Align them properly.
 Right click Select Decorations from controls palette and select a frame which is an optional.
Make sure that the RUN arrow is not broken, if broken rectify the errors.
Now give the inputs and Click RUN( ).
Result Analysis:
When the temperature in Celsius was taken 100 as input .converting Celsius to Fahrenheit the output obtained from the
indicator 3201.8.

2)Check whether a number is odd or even


Aim: To create a VI that checks whether the given number is odd or even
Procedure:

 Open NI LABVIEW
 Click Ctrl+N to open new VI
 Use Ctrl+T to make both front panel and block diagram to appear side by side on the screen

Procedure:
FRONT PANEL:
Steps:
1. Right click on the front panel select numeric-control and its corresponding node is created on the block
diagram.
2. Again right click on the front panel to select numeric-indicator and its corresponding node is appear on the
block diagram.

BLOCK DIAGRAM:
Steps:
1. Right click on the block diagram panel,select numeric and then click the function quotient and remainder.
2. Right click on the function(quotient and remainder) then select create constant,then type the number ‘2’
in the box.
3. Right click on the block diagram panel,select comparison and then click the function “equal”,right click on
the function “equal” go to create constant and then type ‘0’ in it,connect the another input terminal of
function “equal” to the function quotient and remainder.
4. Right click on the block diagram panel,select comparison and then click the function “selector”.
5. Right click on the front panel and then select strings and constants and then select string and place it on the
panel of block diagram.
6. Select the same step and place it on the block diagram.
7. Connect the two strings to the two input terminals of the selector and then type “even” and “odd” in them.
8. Connect the selector and the function “equal”.
9. Connect the indicator and output terminal of selector.
10. Click the run option in the menu bar of block diagram and give the input in the control that is placed in the
front panel and observe the corresponding output as “even” or “odd”.

Result analysis:
When the input in the control is taken as 2 the output given number is even.
3)Implement a Boolean expression
Aim: To implement the Boolean expression Y = ab+cd+(ac)’
Procedure:
 Open NI LABVIEW
 Click Ctrl+N to open new VI
 Use Ctrl+T to make both front panel and block diagram to appear side by side on the screen

Procedure:

FRONT PANEL:
Steps:
1. Right click on the front panel and select Boolean controls which are push buttons.
2. Name the push buttons as a,b,c,d. by double clicking on them.
3. Right click on the front panel and then select Boolean indicator which is LED.

BLOCK DIAGRAM:
Steps:
1. In the given Boolean expression there are three and gates and one or gate
2. Right click on the block diagram panel select Boolean and click “and” gate then connect the two input
terminals of and gate to the two Boolean controls “a” and ”b”
3. Similarly select again an “and” gate then connect the two input terminals of this and gate to the two
Boolean controls of “c” and “d”.
4. Similarly select an “and” gate then connect the two input terminals of this “and” gate to the two Boolean
controls of “a” and “c”.
5. Right click on the block diagram panel select Boolean and select the “not” gate then connect the output
terminal of 3rd “and” gate to the input terminal of the “not” gate so that the output of the “not” gate is the
inversion of (ac) which is (ac)’
6. Select “or” gate which is in Boolean and connect the two input terminals of this”or” gate to the outputs of
1st and 2nd gate,so that the output of this gate is (ab+cd)
7. Similarly select the 2nd “or” gate,and connect the two input terminals of this “or” gate to the outputs of the
1st “or” gate and the 3rd “and” gate.
8. Select the run option in the menu bar of block diagram
9. Give inputs for the Boolean values in the front panel and observe the corresponding output.
Fig2 block diagram window
Result analysis:
When a, b, c, d are taken as 0, 0, 1,0 the output obtained is y=1

4) The salary of x is input. His dearness allowance is 40% of basic salary and house rent allowance is 20%
of basic salary. Build a VI to calculate his gross salary.

Procedure:
1)Open blank VI
2)Go to file and click on new project
3)Enter CTRL+T so that you will get the front panel and block diagram side by side.
4)In the front panel window, place control (inputs) from control palette - > Modern - > Numeric - > Numeric Control , and
label it as Salary(x).
5) In the front panel window, place Indicator (output) from control palette - > Modern - > Numeric - > Numeric Indicator ,
and label it as Gross Salary.

Fig 1. Front panel window.


6) In the block diagram window, place a function called Multiply from control panel -> programming ->numeric - >
Multiply
7)Create a Constant for that as 0.4, as it’s 40% dearness allowances , Similarly for 0.2, as it’s 20% for house rent allowance,
connect it to a another multiply.
8)Now connect the salary(x) to the the both multiply terminals as one input for each
9)In the block diagram window, place a function called Compound Arithmetic from control panel -> programming -
>numeric - > Compound Arithmetic.
10) check all the connections between controls, functions, indicators.
11)Now run the program(Either Run or Run continuously).
12)In the front panel window take any number as input in the control and run the program
13)observe the output for various input numbers

Fig2 block diagram window

Result analysis:
When salary(x) is taken 9000 as control(input) , the output value in indicator is observed as 14400.

You might also like