Hello friends.
Today I will explain you a function that is event structure that is available in LabVIEW.
How to use this in your programming.
So first, as you see over here, I just explain you.
I just continuously run it.
I just push it will increment by one every time when I push it and when I pop it, it will decrease
every value.
So let's do it.
How we go For this particular function, you can create your own.
Like in our microprocessor, we have push and pop instructions if you want to push in that case, in
the case of eight five, you just.
Decrease your location of stack pointer in the pop you will increase your.
Stack position or addressing in the case of 8085 microprocessor.
We can do that.
Also.
It is up to you.
Right now I just use only one increment for push and one decrement for pop.
Okay, so let's drop it and just go to the block diagram window.
As you see over here, I just use a event structure.
I just delete this.
I just go to the structure or here.
This is my event structure.
Just drag and drop.
In this case, you just need two buttons, like over here.
This is my button.
I make it push.
I just make.
Pushbutton in the case of microprocessor, we know that in the case of push instruction, we just decrease.
We just decrease two locations of address.
Okay.
So we just do similar type of case in this case also.
So over here, this is my pop.
This is my pop.
Now I have a meter also, which will show me the location.
Is increased or decreased.
Okay, so over here, let's see.
It is up to 100 locations are there.
So now I just put also a visible digital label over here.
So you just.
So over here I have my meter in the case of event structure.
You just go to the edge.
Right click.
Edit event handled by this case.
As you see over here, this is my first okay button.
That is my push.
I just go with value change.
When the value change is there, you can do any like if you just.
Key down, key up.
You can go with any function.
Right now I just use value change.
Just press.
Okay.
So over here as you see.
Okay.
Button value change function created.
Right now I just go to.
Over here.
This meter.
I just use local variable in this case.
So create a local variable for this.
I want to just change the value.
So in this case, just drag it to over here.
Just copy it.
In this case, as we know, in the case of push button, we decrease the stack by two.
So just make it change to retype.
And over here I just put a increment to increment in this case.
So it will.
In the case of push, we just decrease, not increase.
So I just go with decrement function.
In the case of Bush, he has decreased the address of stack by two.
So this is my function.
So next, in the case of pop, we just add another case.
It is for okay button.
That is.
This is my push button.
Okay, So just go to my button.
I just copy this function in this case.
In the case of pop, I just increment by two not in place of decrement, I just increment by two.
You can use any function right now.
Just let's say.
Add function I'm using.
Or here.
It is increment by.
So this is my case.
It will change the value of this function.
So my function is created over here.
You can also put.
Push.
And this is my pop.
Let's check what happened.
So when I hit on continuous run.
Push, as you see it is decremented by two.
So let's first increment it.
So pop, pop, pop.
It will increase the stack address, as you see over here.
Then I just push it will decrease the stack address.
As many as time I am pushing it.
So in this case also.
You just.
Right click over here.
You can change the mechanical action over here.
In the case of pushbuttons, we have six types of mechanical action like switch.
When pressed in the default case, it is latch when released.
So there are six mechanical actions which, when pressed.
Switch when released.
Switch until released.
Latch when pressed.
Latch when released.
Latch until released.
It is up to you which function you want in your application.
According to your application, you can go with this function.
As you see in this case, it is latched.
When released, it is latched in this case.
Okay.
So I just make it normal.
So this is how you can go with event structure using push and pop instruction.
You can create any event in the event structure.
It is waiting for the event to occur basically.
So this is how you can use event structure.
Thank you.