11-07-2013 09:05 AM - edited 11-07-2013 09:17 AM
HI ni expert,
I need to make an automate tap,
When the User butten is pressed, it suppose to count untill the Timeout Value is reach ,and the light turn on, if its press less then that it won't.
If the light is on and the user release the button ,again, counter untill second Timeout Value 2 is reach. if the user press before the light goes off, its remain on. like in the TAP file.
in my file (test222) i have 2 problems :
1. i dont manage to display the timer right
2. the wait function is not reset if the user is press the button below the Timeout Value's
Thanks in advance,
Solved! Go to Solution.
11-07-2013 09:14 AM
If you could reupload it in 2011.
File>Save for previous version
11-07-2013 09:17 AM
Done, thanks
11-07-2013 09:40 AM
Is this what you meant?
Or do you want to see him actually count?
11-07-2013 09:51 AM
Thanks for the quick answer!
I want him to actually count and display at the GUI, and reset when it need to count again
11-07-2013 09:52 AM - edited 11-07-2013 09:54 AM
wait ms should never be used as a software timer(which locks up the UI from responding), use it for the while loop iteration(otherwise, you have made a "greedy loop" by using 100% of CPU when all cases are False)...please use the tick count or elapsed timer for timing.
11-07-2013 10:07 AM - edited 11-07-2013 10:19 AM
What Apok said is true.
I already changed it.
Hope you like it this way.
The second one resets the timer indicator if you release the button
11-07-2013 02:59 PM
Thanks for the answer!
But it didnt work correctly...
if i keep press the button its switch between timeout1 & 2 and the led is on\off because of that . and its don't suppose to happen.
if Timeout1 has passed and i still pressing the butten the led stays on. if i release the button its count on counter num 2.
11-07-2013 05:54 PM
hi again,
i took ur solution and adujst him, and it works!
thank again
11-08-2013 01:56 AM
Hi
Good to hear that!
Sorry, that I didnt' understand you right away.
Good luck!
Koen