07-08-2009 09:41 AM
hi
The function of the program was to indicate the elapsed time. When the program was run and the switch button switched to true, the indicator showed the elapsed time. And then switched the button to false, the indicator stop to indicate the elapsed time . How can I reset the elapsed time in order to indicate the elapsed time from 0 when the button switch again without press the "stop" button? The program is attached. Thank you.
Solved! Go to Solution.
07-08-2009 09:47 AM
From your description, it seems your code is far too complex. Is this what you are really trying to do?
07-08-2009 10:50 AM
hi Dennis,
I don't think your code could meetneed. I want to indicate the elapsed time by switching the boolean button to true. As the code you write, the indicator could not indicate the elapsed time. Additionally, the elapsed time was repeatedly resetted to 0 when the loop begin to run, it also did not output the elapsed time to the indicator.
ctjh
07-08-2009 11:14 AM
It looks okay to me. Did you set the Time switch to be Switch action rather than Latched?
If the time switch is up, then the elapsed time counts up from 0. If the time switch is town, then the elapsed time is 0.
07-08-2009 11:26 AM
07-08-2009 11:33 AM
Thanks Dennis and Ravens. I know you meaning now. It maybe worked well. I'll try it tommorow.
If I want to set a switch button to choose either the elapsed time count from 0 or count continueously. How can I do?
07-08-2009 11:36 AM
12-05-2018 01:25 AM
You can view the elapsed time by substrating the Tick Count - inside the loop from the Tick Count - outside the loop.