Hello, friends.
Today I will tell you how to convert a given temperature.
So.
Degree Fahrenheit.
Degree Kelvin.
Degree Ranking and degree Celsius.
Basically, this video is for conversion of temperature from one form to another form.
For that purpose, I just first convert a degree Celsius temperature to.
Degree Fahrenheit.
So.
Let's.
Go to numeric palette.
In this numeric palette.
I just want to create a formula.
F is equal to nine by five into C plus 32.
So first I just block it.
Create.
Constant initial value is nine.
Divide by five.
Then over here I got nine by five and I just want to multiply this value with degrees Celsius.
So for that purpose I just create a.
Control over here.
And the label is.
Celsius.
So just connect this one.
So nine by five into C.
Plus 32 will give me degree Fahrenheit.
So over here plus 32 and it will give me.
Degree Fahrenheit.
Create indicator.
So.
Control.
In this case, I just change the view.
Of my control and indicator.
I just change the view on front panel side.
Okay.
So that's why it is.
Viewing like this, you can also change your.
Options.
Just go to tools, options or here there is a front panel mode and this one you can choose any style.
Control.
Style for New VI.
Let's make it modern style.
Just press.
Okay.
Control.
And when I just again, make it the indicator over here.
You can just like this.
Maybe it is not saved.
Let's check.
It is saved.
So now this is my.
Celsius to Fahrenheit conversion formula.
And today also explain you how to go with a modular programming.
Or you can say.
That is our.
Sub concept.
So over here we have patrons.
Just right click over here, go to patrons.
In the case of sub, we can go for maximum number of 28 input plus output ports as you see.
Over here, this is the maximum number of ports you can create in a sub.
But in this case I need only two.
One for input, one for output.
I just select it.
Just click over here, make it input, click over here.
Make it output.
So both are my floating type.
Or you can say numeric.
So just if you want to just change the picture, also just go to the editor icon.
Or here, you just need to.
Book.
Celsius to Fahrenheit.
And in this case, I just delete this picture.
It is just like a paint function.
And from here, you can just drag a temperature.
Picture.
Just press.
Okay?
So as you see over here, Celsius to Fahrenheit.
So.
It's created.
Just save it.
Press control.
Right now I'm just saving it on my desktop.
That is C2.
In this.
Or in this project.
In every case, I'm just using input value is Celsius and output value is it may be degree Fahrenheit,
it may be degree Kelvin or it may be degree ranking.
So this is the first case I just save it.
I just go for New VI.
Because in that case, I'm just creating another formula for temperature conversion.
So let's right now convert degree Kelvin.
So for that purpose you just need.
A addition block because degrees Celsius.
So create a numeric control over here.
It is my degrees Celsius.
Connect it and just add
273.15 two degrees Celsius.
It will give me degree Kelvin.
So over here as you see right now, my.
Function is modified, it is X plus Y, and you just check.
And this x plus five over here, the view is different from the previous one.
So over here, this is my degree Fahrenheit.
Again, just select the pattern.
Select degree Celsius.
Fahrenheit.
Just edit icon.
And over here.
Not in this case.
It is not a Fahrenheit.
It is a Kelvin.
So I just change it.
So first delete this put.
In this case, right now I'm just choosing different function.
Let's check.
Delete this.
I'm using this function.
And over here, I just put.
Kelvin to Fahrenheit.
Celsius to Kelvin.
Uh, the picture is not.
Okay.
In this case, just.
Use another temperature symbol.
Let's check.
Is there any symbol related to temperature?
Available inside this.
So.
Just move to the previous one.
So I'm just using again the same thing over here.
Celsius to Kelvin.
Okay.
So this is my Calvin.
Save it.
Control s again.
I'm saving it, as you see over here.
Celsius to Fahrenheit.
Is there now?
Celsius to Kelvin is just save it.
Now I just go to the.
Another.
In this, I just convert.
Temperature that is available in degrees Celsius to rank in.
So I just go to again, numeric palette.
So ranking is equal to degree Fahrenheit plus four, five, nine.
.67.
So for that purpose, I just again use a addition function.
I already have a formula for Fahrenheit, so I just drag that from the desktop.
I just close these.
I just drag the degree Fahrenheit.
So over here in this case, input temperature is degrees Celsius and it is converted to degree Fahrenheit.
And I just add to my function addition function, just add value for 59..
67, so it will give me the temperature in ranking.
So create an indicator for this.
Rankin And the input is over here.
Degrees Celsius.
So right now this is my degree Celsius.
This is my ranking.
So again, I just change patron over here.
Input is my degree Celsius.
Output is my ranking.
Edit I can also.
As you see over here, you just need to same way, change this picture.
Drag temperature symbol put.
Celsius to Rankine.
It is up to you where you want to put.
Let's say I'm just placing it over here.
It is up to you.
So let's.
Okay, so Celsius to ranking.
Save it.
So input temperature is my degree Celsius.
Now just close this VI, create a new VI.
And over here, just put.
Control.
T Right now I just go to the structure.
This is my structure and I just use a combo box over here, as you see in this combo box, just edit
it.
Edit item.
So initially.
Temperature is in degrees Celsius.
Celsius.
So I just put only Celsius next in this case.
Celsius to Fahrenheit.
Next.
Celsius to ranking.
Next.
Celsius to.
Kelvin.
Okay, so over here, these are my four functions.
Let's.
I'm just moving it above.
And this one at the last.
Press.
Okay.
So right now, Combobox is ready.
And in this case, one function I'm just putting inside it.
Let's say select all.
So is there.
Select.
So these are my different functions.
Best.
Okay.
Make it.
Make the select one default.
Just go to the operations.
Make current value default.
Right now it is default value.
And over here put temperature.
So just connect this function to the edge.
Over here we have different functions.
So initially.
In the false case, let us say it is select.
You just need the inputs.
The syntax should be same over here.
Select.
Is my first function.
Second function is my Celsius.
Add another case.
Or here the function should be C to R.
Next function is.
C to F.
Next function is C to K.
So there are my four cases with select.
So in the case of Select, let's say I'm just using default value.
So over here you need input temperature.
That is in degree Celsius, let's say.
This one.
And over here.
This is my output temperature.
That is indicator.
Numeric indicator I'm using in this case.
So.
Temperature in which form you just require.
So initially, when select is there, let's say there is a default value.
Means degree Celsius goes directly.
But in the next case, again in the case of it is goes to the temperature directly next Celsius to ranking,
you need to just drag the VI of Celsius to ranking inside this just connect Celsius to ranking.
It will convert your temperature from degree Celsius to degree ranking.
Next degree Celsius to Fahrenheit.
Just drag.
Input and connect your system.
And last case is my degree Celsius to.
Kelvin, just connect this as you see over here.
Degree Celsius to Kelvin.
So now my VI is.
Nearly ready.
But in this case, you just need to put some.
Temperature inside this.
Let's check.
Control.
I'm just changing the font size.
It is 32 again on the input side.
It is again, 36 size.
So let's go with the temperature initially.
Let's say I want to check for 20 degree Celsius.
What happened to it when select is there again 20 degree Celsius when Celsius to ranking it is 5 to
7.67 when Celsius to Kelvin.
27293.15.
When it is Celsius to Fahrenheit, it is 68 degree Fahrenheit.
So this is how you can convert one form of temperature to another form.
Right now I am just using a random number over here to create.
Temperature for a specific value, let's say upper bound value of the temperature in degree Celsius
is 100, and the initial or lower bound is zero degrees Celsius.
Okay, so this random number will generate values between zero to.
Under and right now just connect this function.
Text input function to this value.
Control B and right now I'm just creating a while loop over this function to create temperature.
Create stop button.
And I'm just putting a delay here of two seconds.
Let's say in every two seconds, temperature is different.
So my VI is ready.
Put control u.
It will minimize your space.
Right now control u and over here when you hit on run button it will generate it will not require any
input temperature because the input temperature will be given by this random function.
So I just put a temperature indicator also over here.
And the range.
In this case, let's say it is 1000 because in the case of ranking temperature is very high.
Or you can say.
Was out of your limit.
So let's run it.
You can check.
Temperature in degree Fahrenheit.
When we just put degree Celsius, it is 1681.
When it is ranking, as you see.
578.
When it is in Kelvin or here.
This is how you can create your own temperature conversion formula using LabVIEW.
This is all about today's lecture.
Thank you.