Hello, friends.
Today we discuss how to use mathematical function exponential.
In Python and how cool that python code in left for that purpose I just go to my.
Holder that is already created.
So over here in the python integration by code, I already create an exponential.
God.
So I just call this code in my python.
3.9.0.
So I just open.
As you see.
Or here.
This is my pie code.
So this is my code and this I just import and it function math from the python.
So I just use import math right now.
Initially, let's say a result is zero.
I define a function exponent exponent and the variable name is x.
Intended function, the end result is equal to met exp.
This EXP function is available in Python library that is in mathematics.
This method will call this function x.
Then I want to just print result to check the result, then return the result and I want to check the
result for exponent one.
So I just run it and just check it.
As you see, the value is 2.71828182845.
So let's say I want to check the value for.
Exponential value.
So in that case, I just turn it so it asks me to save.
As you see, the value is 148.
Okay.
So this is how you can find out the exponential function of a variable.
So you call this and like view.
I just make few steps.
So first I just remove this because I do not require this at the time.
Just delete this.
So this is my function of Python.
Four.
Exponential.
So I just save it, control it.
Close this.
I just go to my folder and over here this is my exponent vi.
So I just use this as a sub vi in lab view.
To direct the buck.
So it will take some time.
As you see.
Right now it is loading.
So as you see over here, Control D.
So that.
Front panel and block diagram.
It comes together.
It takes some time.
So as you see over here, this is my code to call the python code.
That is exponent dot pi.
So I just want to change this subtraction to exponent.
So I just copy copy it.
And I just place this over here.
It will call that exponent file and I want to change this subtraction to x p so that it will call exponent
function.
So let's check.
So right now C user sounds on the comment python by code exponent so it will provide python.
But to my VA.
So I just save it.
Close it.
I just.
Create a new VA.
So I just go to my folder, go back and over here.
Let's see, I'm just copy this VA.
And this is my XP.
Exponent via OC.
I just open it.
Ignore so or here.
Control right now.
The already created via.
So I have to just change this.
So VA control B and I want to just call the exponent function over here.
So in this case I have only one variable, so I just delete this control.
B minimize this.
So this is my.
Just clean up the wires.
As you see over here.
So in my case.
The service.
Or here.
End up by code.
So I have to just drag and drop.
Just open this.
Go to this.
Drag and drop this file.
Do.
Or here, because this is my guy, as you see, he is there.
So just connect to the module part and just go to the file and just type the function name.
Just copy it because this function name is available in py code.
So I just copy over here.
As you see control, you minimize it.
So in this case, my variable is floating type.
So let's say I want to check the exponent of 2.11.5.
You can check out.
So over here e x p of x, i will get so control as control dx.
So let's say I want to check the result for different values.
So first I want to check for one.
So when I hit on run button.
As you see, 2.71828.
If you want more values or you want to increase the range in that case, just stop it.
Just go to properties.
And over here you can set a display format.
So right now, only six digits are there.
If you want more digits, you just put.
Okay, as you see or here I got the 15 values.
So let's again run it.
I want to check for two, three, four, five, six, seven, eight, 910 exponent oh ten is this.
So this is how you can work with exponential function in lab view using python code.
Thank you.