Monday, 8 August 2016

Experiment 1: Hands on with LabVIEW Software.

Download the pdf files form the link below to get started with LabVIEW.

a) Introduction to LabVIEW. (Download)
b) Comparison of LabVIEW code with C/C++ code. (Download)

Exercise:


All the block diagram images are VI Snippet in .png format. Download the image, drag and drop the image on any block diagram window, it will automatically create all the controls and indicators in the front panel. Just save the VI and Run.



1. Testing of a number for Odd or Even.

     a) Using Select function:
                          


It is a simple VI code to test a number whether odd or even. Just input a number in front panel through a numeric control leveled as "I/P Number" and click on run button. the VI will show the result. It is done using two level select palette called "Select". It is found inside comparison function palette in block diagram.

   b) Using case structure:



This VI uses case structure to find out the number whether odd or even. Remember Case Structure in LabVIEW is just like switch/case statement in C/C++ and Select function is like If/Else statement.

2. Design of calculator using Case structure


    a)Using numeric case

 

      b) Using string case:


Note: The string input as function is case sensitive. It should match the string written inside the case structure selector level between double quote. Make one of the case as default otherwise the VI shows broken arrow run button.

    c) Using ENUM case


   
 3. Sum of  n numbers

     a) Using feedback node:



   
      b) Using Shift Resister:



4. Factorial of a number:

     a) Using feedback node:



      b) Using shift resister:



5. Sequential Execution of code using Flat Sequence

This VI demonstrate sequential execution of code in LabVIEW using a structure called Flat Sequence.
Two LEDs are here viz. LED1 and LED2 that blinks sequential manner with some ON and OFF time delay.
The LEDs are made OFF by using their local variable. You can create local variable/indicator of a variable by right clicking on that variable and click on create----> local variable.
The input to the LEDs are constant Boolean. You can get it from Boolean Function palette or by right click create--->Constant at the left side of the LED when you see the Wire bobbin.

 Download the file here.


6. Conversion of Decimal Number to Binary, Octal and Hex Code using LabVIEW.

This VI converts Decimal Number into Binary, Octal and Hex code format of different bits.
Give the Decimal Number---->Choose the conversion code----->choose the bit and click on run button, the labview will convert it and show the result in array format.
As per the bit and conversion code type the maximum decimal number is varied and restricted. Example: if the code is selected binary and the bit is selected 4 then the maximum value of decimal number is restricted to 15.
This VI uses case structure and Flat Sequence. The restriction property of decimal variable is done by using its property node.
right click on the variable create----->Property node------->Data entry limits----->maximum.


Download the LabVIEW file.

7. Saving LabVIEW data in a text file with proper format and leveling.

This VI snippet saves LabVIEW data in a text file. You can get the file palette from Programming----->File I/O.
The 'Set file Position' helps us to append data with the previous data. You can get set file position from File I/O---->Adv File Function----->Set File Position.



No comments:

Post a Comment