Hello, friends.
Today we were with Python and I want to create different functions like sine wave and host wave.
Using Python code and I want to float that code in my lab view.
Function for that purpose.
I just go to my order
and over here I just copy this addition code.
And over here, I just paste it, just rename it float.
Fine Lord underscore sign underscore cause dot fine.
So the name is changed.
So right now I just open this in my cell.
So open.
Command Python, python code.
So over here, the basic function is written for the edition.
So first I want to import math function because sine function is available in this directory and I want
to just put, let's say R or you can say result is equal to zero or here R is very to match dot sine
of the function x.
So over here this is x input variable x.
So over here this is my sine function.
It will return r.
Okay.
So I just copy this
paste over here.
In this case, I want to go for both zero less.
And over here the function is indexes cause.
And the result is, let's say r one or here I want to put r one is equal to zero in this case and over
here r one.
So it will create false and sine values.
So I just close this right now and I want to just go to my folder or I want to change the sub v over
here.
So control E in this case, my name is just rename it Control Z.
Just put this part inside.
But so block underscore sign underscore force dot by control.
P Now I want to change this.
I can also.
So I just put
sign and course.
Okay, so you give me sign, it goes.
So let's save it.
Check the pot.
What is done with it?
So go to the Python integration lab folder.
Just copy this function.
Let's say paste it over here.
Just make it rename it sine, underscore course function.
So just make it or here cosine and course is available over here.
Ignore it.
Control p.
Just modify the code.
Because in this case I only require single variable.
I want to also delete this control.
Be this also control B and over here I want to require, let's say in this case I need sine function
and just call the.
So via Python, just drag it.
So make it over here.
Place it.
So sign and cause.
Service is available over here.
So just
minimize this.
Go to the code.
In this case, I need sine and cause both the values.
So for that purpose.
Just first, use a simple error handler over here.
Delete this in this one and delete this one also.
Just copy this.
Connect this function to the zero.
Dysfunction or sign out error out to error in you see so right now or here this is my post function.
So the name of the function is C or less C or less.
So right now just the module is all the same.
B and over here the variables would be same, let's say.
Okay.
And over here I got the sine value or here I go to the cost value.
So for that purpose I just use different charts, let's say in the first case.
So I just delete this also because I want to use iteration.
And when these iterations are equal to so I just put a comparison.
So in these situations is equal to.
So just delete this also control B when these iterations value is equal to let's say create some control
over here, this control will define how many values I needed.
So let's say it is 100.
So I just use chart over here.
So single chart is there.
So this I put charts over there for one is for course value and one is for sine value.
Just connect this to that.
I want to merge these two signals.
Control you minimize this control you control e let's run it.
So as you see over here, I got the sign value and it is starting from zero.
And over here I got cost value.
It started from over here.
So let's I also want to change its frequency.
So for that purpose first, I want to just, let's say mark these two signals.
So I just go to build a function.
Let's check what happened.
So over here, the signal or here's another signal these days and it will create control B control D
control D So run it.
As you see, I got this type of signal over here and if you want to float both the signals simultaneously,
in that case, I just use another function.
So first I just go to the edge of the edge or here make it down mode indexing.
Make it normal indexing on.
And now let's check what happened with the validity function dash edge.
And now I just use let's say graph or here connect this graph to this and run it.
So as you see, I got both the values.
So right now the number of values are more.
So I just run it only ten times as you see sign and those values are over here sine value start from
zero post values start from one.
So this is how you can plot sine wave and false wave using python code in live view.
Thank you.