You are on page 1of 10

DATE: 04-11-15

INTRODUCTION LABVIEW
AIM:
(1) Convert temperature in Celsius scale to Fahrenheit scale
(2) Generate random numbers from 0 to 100 and stop the program if a number greater than
90 comes.
(3) Write generated values in notepad
(4) Stop the above program after 10 seconds or if a number greater than 90 comes(
whichever comes first)
(5) Add two numbers A and B if A is greater than or equal to B, IF A less than B multiply
those numbers
(6) Generate a sinusoidal signal and obtain its spectrum

1. Celsius to Fahrenheit conversion


Block diagram

Front panel

PROCEDURE
1. Open new vi
2. Right click on front panel >> Numeric>>Numeric control >> rename it as Celsius
3. Right click on block diagram>>Numeric>>select MULTIPLY block
4. Connect output of Celsius block to input terminal of MULTIPLY block

5. Right click on other input terminal and create constant write 1.8 as constant
6. Right click on block diagram>>Numeric>>select ADD block
7. Connect output of MULTIPLY block to input one terminal of ADD block and Right
click on other input terminal of ADD block and create constant write 32 as constant
Right click on output terminal of ADD block and create numeric indicator
8. Add a Celsius value and press run button
9. To run the above program continuously create a while loop and enclose the above
program in while loop
10. Right click on condition terminal and create control
11. Give a delay of some milliseconds
Right click on block diagram>>timing>>wait(ms)
12. Run the program

2.

Random signal generation


Block diagram

front panel

PROCEDURE
1. Open new vi
2. Select random number generator
Right click on block diagram >> Numeric>> random number (0-1)
3. Multiply the random numbers (0-1) by 100 and convert them to nearest integer values
Right click on block diagram >> Numeric>> Round to nearest
4. Compare with 90 and connect the output of comparison block to condition terminal
make condition as stop if true

3. Write operation

Procedure
1. Select write to measurement file
Right click on block diagram >> file I/O>> write to measurement file

2. Select required conditions in write measurement file properties like where to write file
format etc.
3. Run the program
4. Generated values can be obtained in corresponding place mentioned
Observation

4. Stop timer

,
Procedure
1. Generate elapsed time block and mention time required for the program to run
2. Right click on block diagram>>timing>> elapsed time

3. Connect time has elapsed to conditional terminal of while loop.


4. Since output is a combination of two conditions ( Stop the above program after 10
seconds or if a number greater than 90 comes( whichever comes first)) give both
conditions to the input of an OR gate and connect output of the OR gate to the condition
terminal
5. Run the program

5. Case structure
Add two numbers A and B if A is greater than or equal to B, IF A less than B multiply
those numbers

Procedure
1. Generate control inputs and rename them as A and B
2. Generate case structure
3. Right click on block diagram>>structure>> case structure

4. Compare them connect output of comparison block to condition terminal of case


structure
5. Write operations required in true and false case

6. Signal and its spectrum


1. Open new vi
2. Select simulate signal
Right click on block diagram >> express>> input>>simulate signal
3. Mark no of samples required ( maximum frequency should be half of no of
samples)

4. Create control inputs to frequency and amplitude

5. Create graph indicator


6. Run the program vary frequency and amplitude.

7. Select spectrum
Right click on block diagram >> express>> spectral analysis >>spectral

8. Connect simulate signal output to spectral input and create graph indicator at
spectral output
9. Run the program.

You might also like