LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopwatch

Hello, I am trying to make a simple stopwatch with start, stop, and reset functions. The stopwatch I made however is not able to be reset as the clock is running. If it is running and the reset button is hit it displayes a random time. If the reset is hit when the stopwatch is off it works fine though. If anyone knows how to fix this it would be greatly appreciated.

0 Kudos
Message 1 of 10
(913 Views)

Why do you think you need all these shift regsiters?

Why do you divide by 1000, just to multiply by 1000 a nanosecond later?

Did you search the forum for stop watch.

Tick count is random, so you to reset to need to feed the current tick back into the shift register, not zero.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 10
(898 Views)

Hi Matthew,

 


@MatthewS1112 wrote:

If it is running and the reset button is hit it displayes a random time. If the reset is hit when the stopwatch is off it works fine though. If anyone knows how to fix this it would be greatly appreciated.


Well, it would be much easier when your code would be cleaned up:

It also would help to provide more comments in the code, especially on the purpose of each of those 3 shift registers!

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 3 of 10
(894 Views)

Here's what I might do.  Simplify! (Do you really need milliseconds???)

 

(Of course personally I would just convert to seconds (DBL) and use a single indicator using time display).

 

altenbach_0-1588102881480.png

 

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 10
(878 Views)

@altenbach wrote:

(Of course personally I would just convert to seconds (DBL) and use a single indicator using time display).

 


altenbach_0-1588103416080.png 

altenbach_1-1588103451390.png

 

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 5 of 10
(865 Views)

Don't have 2019... what is the formatting you used for the time display?

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 6 of 10
(859 Views)

Hi Frozen,

 

relative time, HH:MM:SS with 3 digits for milliseconds…

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 7 of 10
(856 Views)

@Frozen wrote:

Don't have 2019...


It would seem more important to know what you have. 😄

 

Here's a 2015 version....


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 8 of 10
(850 Views)

Thanks!

Frozen_0-1588104986400.png

 

That is what I was looking for 🙂

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 9 of 10
(838 Views)

You could even get rid of the high precision seconds at the expense of an additional division, like so

 

snip.png

mcduff

0 Kudos
Message 10 of 10
(799 Views)