Hello, friends.
Today I just tell you how to go with different waveform with the help of an M function.
So right now just go to New VI, Ctrl t
or here in the ring and you just find out an M control or here you just edit it, select it, edit items.
As you see over here right now.
I just put.
Let us say sign.
Then I have another wave that is square wave.
Then another way is triangular.
Okay.
And it is up to you.
You can move.
It up.
It is up to you.
Okay.
And another function is, let's say select.
You need to select first.
So it is on the top.
Okay.
So this is my select over here in the data operations.
I make it current value default.
So in this I have three waveforms.
I just now go to the structure.
As you see over here.
I just go to the.
Signal processing.
Waveform generation.
I just lock it.
I just use three waveforms.
So first I use sine wave.
I just place over here.
So when I just connect my structure over here.
In this case, there are four cases.
First one is select.
Second one is sign.
You need to add on add case after.
Add case after you just got all the cases.
So I have these four cases right now.
So in the triangular I just put triangular waveform and in the square wave I just put square waveform
over here.
So now in this case, I just need to create control for frequency.
So this is the control for the frequency.
Then amplitude create control for amplitude.
I just put outside the structure.
Next phase create control for the phase also.
It is up to me.
And over here, if you want to reset the signal offset duty cycle, it is up to you.
Right now I just use only these three control signals.
Then I just go to the sine wave.
So over here, this is my frequency connect frequency over here.
This is my amplitude.
And over here this is my phase.
Then just go to the triangular function.
So this is my frequency.
Amplitude, and this is my phase.
So over here I got the waveform.
Just connect it.
Connect this and Squarewave over here.
So right now, just close this over here.
I just take a graph.
So this is my graph.
Connect this graph.
Now, in the case of select, you need to put any value or let's say, make it default value.
So let's say in the case of.
This I just create or I just put.
Any value that is, let us say zero.
I want to.
Send.
So you need to change.
So create.
Constant over here.
So it will generate this value.
Okay.
So over here we have different.
Controls.
Just change this controls.
I want to just replace these controls with these dials or knobs.
So right now I just use this dial for the frequency.
And this frequency component I just put over here.
And the maximum frequency, let's say 100.
Amplitude.
Again, I just replace this with now, let's say.
Over here.
This is my.
No.
This is my amplitude.
I just place it over here.
And the amplitude, maximum amplitude, let's say 100 and over here, this is my face again.
I just replace it.
Width dial.
And the phase is, let's say 360.
So this is my phase.
I just make it large.
So over here I have the waveform.
In this case, based on the function, I just select different waveforms.
So initially it is in the select mode.
Let's run it.
So it is not showing any value.
So you need to just.
Change the value.
Let's say in this case it is triangular.
Let's check what happened.
So phase is zero initially.
So as you see over here, I got the triangular value.
And if you want to continuously run this.
You just check the amplitude over here and over here you just check the frequency also.
I'm just changing.
And if you.
Over here.
Let's say this is the frequency and this is the phase.
Just change.
You just check the phase of the way.
Right now.
It is changing.
Zero two, as you see.
Just see the right hand or left hand.
Over here.
The phase is changing.
Okay, So if you just want to go with another wave, just go with another wave.
Let's say over here, we just got the square wave.
This is the amplitude and this is the.
So if you want to just also make this waveform graph.
Just change from it.
Auto scale.
So the maximum value is ten and the minimum value is again, let's say minus ten.
Okay, so the amplitude is maximum minimum.
And over here, this is the phase right now for the continuous run.
I just make it inside a.
While loop.
Create a stop button over here.
Just go to the loop.
Go to the block diagram.
Run it again.
As you see, it is running.
And if you want to change the frequency.
As you see.
If you want to change the amplitude, it is up to you.
And if you want to change the face.
Like this.
So it is very fast.
So you just put a delay inside it also.
Create constant.
Let us say 100 milliseconds delay is there.
If you want to just change the delay, also make a control for it.
Change to control.
As you see over here, we just got the control for delay.
Right now, let's say it is 300.
Run it again.
So you just check the frequency.
Just check the amplitude.
Right now, you check the phase and you just change the waves.
Also, right now, it is sine wave.
Then again, select sine wave, square wave, triangular wave.
This is how you can use function for different create different waveforms.
This is all about today's lecture.
Thank you.