ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer within a timer

hi, 

 

I have been trying to display three different timers. The test should keep repeating as long as the timer has not reached the deisred value. For example two states, turning a lamp on and off. Therefore the three timers. For example a 20 hour test, where every 40 seconds the lamp turns on and the next 20 seconds stays off, this repeats for 20 hours. Somehow I get strange results with the Elapsed time Vi. Sometimes the time does not start from zero as it should. The timers only refresh every time the a cycle has been over. Is it posible to display the time at all times?

 

Thanks in advance. 

0 Kudos
Message 1 of 6
(2,570 Views)

Please, explain the deatils of the project a bit more detailed. 

0 Kudos
Message 2 of 6
(2,503 Views)

How about something like this? (see attached)

 

I like to use actual time for things like this as you can do (some) math on timestamps directly and you can compare time stamps directly

 

EDIT: Oops you also wanted time display too. I updated it

========================
=== Engineer Ambiguously ===
========================
Message 3 of 6
(2,484 Views)

You forgot to add a delay in your loop to prevent a "CPU burner" loop 🙂 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 4 of 6
(2,473 Views)

@Frozen wrote:

You forgot to add a delay in your loop to prevent a "CPU burner" loop 🙂 


Sure but I only spent 5 minutes on that as an example, the OP will have to worry about those details.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 6
(2,471 Views)

Thanks everyone for your comments and solutions. I already solved the problem by not using the Elapsed time Vi and using a basic countdown timer with a time (ms) Vi. I am running two parallel timers, inside a while loop. It is working now. Thanks again. 

0 Kudos
Message 6 of 6
(2,430 Views)