LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I reset the elapsed time

Solved!
Go to solution

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.

0 Kudos
Message 1 of 8
(10,914 Views)
Solution
Accepted by topic author ctjh

From your description, it seems your code is far too complex. Is this what you are really trying to do?

 

 

Reset time.PNG

Message 2 of 8
(10,908 Views)

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

0 Kudos
Message 3 of 8
(10,890 Views)

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.

0 Kudos
Message 4 of 8
(10,881 Views)
maybe it doesn't work because when the time switch is down the output of the switch is false. Only the value is true can run the case structure as I codede. Even the output of the switch is ture when the switch is down, the elapsed time can not count up from 0 as the elapsed time is run when the case structure is true. 
0 Kudos
Message 5 of 8
(10,875 Views)

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?

0 Kudos
Message 6 of 8
(10,873 Views)
When the control is set to true, the indicator does show the elapsed time. When false, yes the indicator does show 0. If you want it to show the last time, that's a simple mod.
0 Kudos
Message 7 of 8
(10,871 Views)

You can view the elapsed time by substrating the Tick Count - inside the loop from the Tick Count - outside the loop. 

0 Kudos
Message 8 of 8
(6,557 Views)