Saturday, March 30, 2013

ConvertingTemperature from Celsius to Fahrenheit using LabVIEW



Converting Temperature from Celsius to Fahrenheit

 Hi Guys,Well, here’s the program which I did for converting temperature from Celsius to Fahrenheit. I had done this conversion using 3 different methods. But it has only on formula

i.e;                       Fahrenheit = 1.8 * (Celsius) + 32

1st Method is by using Mathematical Expressions like Addition, Multiplication,etc., from Functions Palette - Arithmetic & Comparison - Numeric

2nd Method is by using Formula Node which is available from Functions Palette - Programming - Structural - Formula Node.

3rd Method is by using Formula, which is available from Functions Palette - Arithmetic & Comparison - Formula.
The program for converting temperature from Celsius to Fahrenheit is given below
Program for converting temperature from Celsius to Fahrenheit.
  • For the 1st method, just addition and multiplication is used.
  • For the 2nd method, we use the formula node method, where we have to specify some formula.
  • Here, i have specified the formula as y=m*x+c; and defined m and c as constants which are 1.8 and 32 respectively and x as a variable input.
  • Thus the output is defined by 'y' and given it to the indicator.
  • The last method is quite same as the 2nd but the formula has to be specified in a dialog box and it does the rest...
That is all, the temperature will be converted from Celsius to Fahrenheit.

Regards
KiranSravan

Saturday, March 2, 2013

Finding Prime Number using LabVIEW


Finding whether a number is prime or not

 Hi Guys, i had done some basic VI programming, since i wanted it to share i am starting with this post.

Well, here’s the program which I did for finding whether its prime or not, i have used for loop to build a logic for this program.
Prime Number
Front Panel and Block diagram Panel for this program
  • Firstly, i took 'for loop' and gave 10 for count terminal and for the iteration i added with 2, since it starts from 0.
  • Then i took the 'Quotient and Remainder' from 'Numeric'.
  • Here i gave the iteration terminal 'i' to the shift register and also initialized the register as 1.
  • Now, i connected the shift register to the denominator of 'Q&R' function.
  • An Numeric control is connected to the numerator
  • Now, after the division, if the remainder is 0, the output becomes true and is converted to 1 and is summed by the 'Add Array Elements'. 
  • Thus the logic is if the sum of 1 exceeds 2 then it is not a prime number and if it is less than or equal to, then it is a prime number.
Above steps are the logic for 'finding whether it is prime or not' program and here is the working video of that program...

You may also download the original file by clicking on the link shown below
http://www.sendspace.com/file/8cl2ds

This is it of now, will post other logic in the next post....Till then

Greetings From
KiranSravan