LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

uniterrupable timer!

Hi
I have designed a very simple "countdown-timer" funtion - which is activated by a boolean true - and keeps gooing even when the boolean changes, my problem is that the design causes the timer to count double after the boolean changes (see example and you know what I mean) - is there anyone how can come up with a simple way to correct this??
 
 
0 Kudos
Message 1 of 14
(2,783 Views)

Hi

Could you post your vi as LV8.0 or post a screen shot of the block diagram?

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 14
(2,768 Views)
hi - here it is in version 8.0
0 Kudos
Message 3 of 14
(2,767 Views)
Could you explain what the purpose of this vi should be? Because in my understanding a "countdown-timer" counts down from a specified time until it reaches zero.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 14
(2,761 Views)
yes - ok a "count-down timer" was not a very precise description -- the purpose of the VI is as follows: When a boolean is set TRUE a signal should be set high (boolean TRUE) for at least X sec. - that is the timer should keep on going even when the boolean that activated the timer changes back to FALSE. The problem is that when the activating boolean changes back the timer begins to "count" at double paste!
0 Kudos
Message 5 of 14
(2,754 Views)
sorry - it is the other way around! the timer counts double and when the boolean changes to FALSE it counts as it is suppose!
0 Kudos
Message 6 of 14
(2,752 Views)
Howdy,

This seems a bit overcomplicated, but here's a couple of suggestions:

When the Time Elapsed equals the Active Time, you should turn the Activate Timer switch OFF.
You're doing a lot of converting from a number to a boolean and back for no reason. You can simply compare numbers and use the true or false from the comparison to do the same thing.
Have you looked into using an event structure and its built-in Timeout?

Here's a much simpler method:
Suggestions: Decrease Timeout value to 100ms, and multiply the Active Time by 100 inside the block diagram to increase the application's speed.
There are 100's of different ways to generate a countdown, this is one of them.

Good luck!

- Smiley Happy
Message 7 of 14
(2,749 Views)

The key to your solution is the boolean function.

I attach you a modified vi - just have a look at it.

The timer starts if the switch is set to true for the first time - afterwards the switch has no more influence.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 8 of 14
(2,748 Views)
OK - great that works perfect! and yes a little simplier than my faulty design! ------- is there any easy way to implement the following: after the timer has timed out it cant be turn on again before X sec has passed?? if it is easier the same number of sec may be used!
0 Kudos
Message 9 of 14
(2,736 Views)
Yes of course it can be modified to meet this need. Do you just need it to implement some kind of "wait" function? Or do you control a device inside this function? Do you need the active state on the screen?
Depending on different points, you can use a different solution.
 
Basically, you can use my example inside another loop and you can start it over and over again. As I was not able to have a look at the other vi, I can't comment on it.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 10 of 14
(2,731 Views)