12-13-2011 08:11 AM
I need to generate short pulse during changing boolean value from 0 to 1. This pulse is needed to reset counter.
I was trying with Event Structure with Value Change but I think that I did something wrong.
Maybe sambody can give me some tips to do it in other way?
Thank you in advance.
Regards
Solved! Go to Solution.
12-13-2011 08:20 AM
Where is the problem?
Is it the part of detecting a change of the boolean going from F to T?
Or is it the part of resetting the counter.
The Event Structure with Value Change is a good.
What is the mechancial action setting for your boolean control?
Most likely need to be one of the latched setting "Latched When Pressed"
Post your code.
12-13-2011 08:23 AM
Try something like the attached code - a simple Functional Global.
12-13-2011 08:41 AM
Resetting counter is not a problem.
Well, problem is that I don't know how exactly Event Structure for change value works. I know how to use it in other cases but not in this one.
I attach my code.
My x > y value will change once. From F to T. And then I want to generate one impulse which resets counter.
Thank you for your responds.
12-13-2011 09:28 AM
@Rogal wrote:
I need to generate short pulse during changing boolean value from 0 to 1. This pulse is needed to reset counter.
I was trying with Event Structure with Value Change but I think that I did something wrong.
Maybe sambody can give me some tips to do it in other way?
Thank you in advance.
Regards
We assumed you wanted a pulse when a front panel button (boolean) was clicked.
I am still not sure just what it is you want.
Do you want a single pulse when x is greater than 4?
You don't need an event structure for that.
12-15-2011 12:52 AM
Yes, I want to generate short pulse when x is greater than 4. It works but I would like to use it in one while loop and use this impulse in other while loop to reset counter. And in this case it doesn't work.
I guess that impulse is too short and before signal goes to other while loop it again toggles from True to False.
12-15-2011 01:51 AM
I added to both loops 50 ms of timing and now everything works fine.
Thank you for your help and patience.
Best Regards.
12-15-2011 11:49 AM
Use a queue
10-14-2015 01:28 PM
Hello Broken_Arrow,
Many many thanks for this example, it helped my app to work.
But I still have a question about this, have you hide something in the code, because I made a same one, but it is not acting the same?
When I run mine, the value stayes on, constantly, not pulses like yours.
Regards
Szilard
10-14-2015 01:34 PM
@SzilardB wrote:
Hello Broken_Arrow,
When I run mine, the value stayes on, constantly, not pulses like yours.
Share your code so we can help you figure out what went wrong.