Hello, friends.
Today we discuss how to divide or how to call or divide.
Function from Python to left you for that purpose.
I just go to my folder and or here I just copy this already created by and python code.
So as you see over here and I want to just rename it.
So the I've let's say.
So the board mentions name change and I also want to put its name complete over here.
The I've I'd divide.
Okay.
So this is my code and I just open this code in by ten cell.
So just go to the command python integration by code.
And over here, this is my divide or it is subtraction code, so I just change it.
So the function name is David, let's say, and it is for X and Y and the my operator is divide.
And initial result is zero.
So I just want to check the result for that purpose.
Print.
Result.
And I also check for the value divide.
Divide.
And over here, this is my value should be, let's say, seven divided by two.
And I want to check the result.
So run it so the value it will
making some error.
Both divide seven by two.
So let's check what happened.
Fine result x divided by Y, x and y.
Okay, so I just put operator over here.
I need comma over here.
So by mistake.
Sorry and I just run it.
So now the value is 3.5.
So this is how you can divide using python.
So I just go back to my code and I want to change this.
And I also want to delete this.
So my return function is this I save it.
Closing.
Minimize this.
Now I want to change the Part IV.
So in this case or here, the parts would be divided.
In the case of subtraction, divide it.
We call this code.
And I also want to change the.
This I can.
So in this case, I just use the IV.
Okay.
Control is close.
So now.
I just go to my.
I can integration forward and over here I just copy this multiply code and paste it over here and the
name should be renamed.
So that is the IV underscore two.
As you see, I just open this ignore and in this place I just operator should be divided X divided by
Y go back or here in the case of or here it is calling multiply and it is calling multiply.
So I just delete this and in the place of the ivy ivy and I just.
Go to PI code.
And over here I want to just drag and drop this.
Sir.
I just drag and drop this.
Over here.
This is the service module path, so connected.
So my program is ready right now.
So let's check the result for this.
So in this case, the X should be seven and why it should be two for the same results.
So let's check the result.
The result is 3.5.
So this is how you can call divide by function in lab view.
So let's check some more.
So in this case, numeric palette or here, this is my divide function.
This divide function is similar to this.
Okay.
So, again, I just create control for this.
Create control for this.
So this is X variable.
This is very variable.
And over here, this is my indicator.
And I just put a y loop over here.
So this court is written in view and this code is calling python code and the result of both of these
are same.
Okay, so let's.
Change the code.
So in this case over here, I'm using this orange color.
This orange color stands for floating value.
Let's delete or rip.
Change the representation.
I want to change the representation to hi 32 over here as you see it is changed to integer value.
And over here this is integer value is converted to floating value.
And again, if you want to check the result of seven divided by two, you can check it is three because
the result is in formal integer right now as you see or here integer value comes from this.
Let's change the representation to 32 again if you want to put nine divided by two in that case, also
you will get four.
And the input of this variable is, let's say I want to check for nine divided by 9.5 divided by two.
It will also produce integer value.
Okay, you can change the representation of these.
Controls using this or here, there are different formats.
This is for floating value.
This is for integer value.
And in this case I 32 stands for to raise to 32 means its range.
These are unsigned number and these are unsigned word.
This is byte ward, long ward.
So this is how data is different formats.
So this is how you can use different.
Metric format for your operation.
Thank you.