LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay a signal

Good morning everyone,

 

I've got a issue with labview and I hope one of you guys knows how to fix it. I'm new to labview so it might be easy, but I've tried everything and just can't find how to make it work. Now lets get to my problem.

 

I've got a case structure in a while loop. In the while loop I have a switch to set the case structure to true or false. When I don't press the switch the case structure is false and a counter in this false state is counting. If I press the button the case goes to True and the counter stops. When I release the switch the counter starts again.

Now I want to add a delay to the restart of the counter so that if I release the switch 1,5 seconds later the counter starts again. The counter still needs to stop instantly when I press the switch.

 

So far I've tried putting timers, elapsed time, waits and everything but the effect was never what I was looking for. The delays where doubled, was between 0 and 1,5 seconds depending on when the button is pressed and more like this. Is there anyone in here that knows how to fix my problem?

 

Greetings,

Paul

0 Kudos
Message 1 of 4
(2,918 Views)

You need to add a way to remember the previous state of the switch, and then wait when the switch is false, but was true on the previous iteration. You could use a feedback node or shift register, e.g.

 

CounterWithWait.png

0 Kudos
Message 2 of 4
(2,907 Views)

Thx for the help. This does work. Now there is just one more thing. Is it possible to restart the wait timer when it is still in the 1,5 seconds wait time?

0 Kudos
Message 3 of 4
(2,896 Views)

As far as I know the Wait VI can't be stopped. You could make your own timer from the Tick Count though:

 

CounterWithWaitAndStop.png

0 Kudos
Message 4 of 4
(2,889 Views)