LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopwatch without pausing the program

Solved!
Go to solution
I was wondering how to make a stopwatch which recorded time, but did not actually stop the program. The wait function actually waits at that part of the program, and my idea was to take the time stamp at the beginning and then the timestamp at the end and see the difference, but I had trouble formatting the timestamp to ashow me ms, which I need. Is there any other VI which does this?
0 Kudos
Message 1 of 12
(7,413 Views)
In the same pallette where you get the current time in secs, there is Tick Count (ms) which will give you ms. Subtract the two instances to get the delta time in ms.
0 Kudos
Message 2 of 12
(7,404 Views)
I was able to find some examples of a stopwatch implementation here and here when I did a quick search. Is it possible for you to post your code so we can understand your question and help you with your application?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 12
(7,403 Views)
Solution
Accepted by topic author The Bulgarian

I am attaching a stopwatch VI I just made. It has the 'Lap' function built into it as well.

 

You can put the main execution code in the execution 'while' loop. This way, there would be no pause or delay in the stop watch or the your main program. You can even control the execution of the main program by passing some control parameter from the stopwatch loop to the main loop.

 

Hope this helps.

 

Cheers!!!!

Message Edited by Mani's World on 12-28-2008 02:32 PM
Message 4 of 12
(7,371 Views)
Thank you Mani's World for that VI, it fixed my problem
0 Kudos
Message 5 of 12
(7,355 Views)

I'm happy 'The Bulgarian' that the VI worked for you. Could you please mark it as the Accepted solution if you think so and also clicking on 'Kudos' is the best way of expressing your appreciation!!!.

 

Cheers!!! 

Message 6 of 12
(7,338 Views)

Hi everyone,

Im new to LabVIEW so excuse my question if it is trivial. I'm working with NI ELVIS and I'm trying to measure time betwen two signals brought on digital inputs. I have manged to acquire signals from digital lines, so for simplification of problem let's just say that i need a value of time betwen two toggle switches in active front panel. It desent mater if the diference is between rising or falling bridges. My actual goal is to calculate speed but I need time diference between the impulses for that. I hope I explained the problem properly.

This one is for graduation, so guys if you can help out I would much apriciate it 😉

(P.S. I'm working in LV7.1, so if you have solution of problem in higher LV-s please post a picture or something. THNX)

0 Kudos
Message 7 of 12
(6,942 Views)

This thread was started in 2008.  You should start a new thread.  Can you not use the Tick Count function?  Get the tick count when one switch is activated, then get the tick count when the second switch is activated.  Subtract the two to get the time in milliseconds.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 12
(6,905 Views)

Tried that, desent work, i guess cos the data is not present at the same time for substract. I figure i need some kind memory element. I'm not realy good with array's. Thanks for help. So shuld I start new topic now or should i stick with this one?

0 Kudos
Message 9 of 12
(6,892 Views)

This is how to implement a simple timer:

 

timer.png

 

- tbob

Inventor of the WORM Global
Message 10 of 12
(6,887 Views)