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
(1,051 Views)

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

0 Kudos
Message 2 of 6
(984 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
(965 Views)

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

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 4 of 6
(954 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
(952 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
(911 Views)