LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean switch until released counter + tick count

Solved!
Go to solution

Hi, I want to use a boolean push button (switch until released) in order to count to a specific value and when getting this value (while continually pushing the button) to turn on a led. If I release this boolean button I want it to count the time up to a specific value and then to turn off the light, like a hand detection for a hand dryer.

I was thinking to use the tick count in a flat sequence with a delay for the specific time I want and to devide it to a true/false case but the problem is that the count of the tick count is continuous and not stoping at the specific value I want for the truning on/off the led.

Any help?

TNX

Guy

0 Kudos
Message 1 of 26
(5,512 Views)

you could not use switch until released for this one as I know maybe this vi could be helpful for you 

0 Kudos
Message 2 of 26
(5,500 Views)

The Elapsed Time express VI seems to do the job here.  Just reset the time whenever the button value changes.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 26
(5,491 Views)

I will try that but I suppose to do it with tick count.

TNX

0 Kudos
Message 4 of 26
(5,477 Views)

the file you attached is not working due to some error.

TNX

Guy

0 Kudos
Message 5 of 26
(5,475 Views)

and can you please explain why do I need the registers?

Didn't get the green square befor the "not equal" icon, if you can explain this too or attach your Vi.

Tnx a lot

0 Kudos
Message 6 of 26
(5,471 Views)

OK , I got a Vi that does almost what I need (attached). I need that if the user give a specific values for timeout1 and timeout2 than the count will run to that number and than will stop and will not continue from the begining so that the led will not blink on and off.SEcond thing , when releasing the button if the led is on I need a count to timeout 2 an at the end of it to turn the led off.

Anyone?

0 Kudos
Message 7 of 26
(5,461 Views)

Sorry, I don't understand all your requirements, but I would highly recommend to use an event structure. For a switch until release you get two event, once when pressed and one when release and you even get the tick count for free. No need for all that extra convoluted stuff.

 

Here is a very simple example that displays the time since the down-press and then displays the final time on the release. Modify as needed.

See if this can give you some ideas.....

 

 

 

0 Kudos
Message 8 of 26
(5,453 Views)

Hi, I need the button to be a detector of auto tap or auto hand dryer. after detection of timeout1 iwant it to turn the led on, when releasing the button timeout2 is running and when getting to timeout2 the led turns off ( the led is the tap or hand dryer). In the prgram you gave the led blinks.Tnx anyway 🙂

0 Kudos
Message 9 of 26
(5,449 Views)

@GuyGor wrote:

 In the prgram you gave the led blinks.Tnx anyway 🙂


As I said, my code is only a starting point skeleton. Notice the "modify as needed".

 

Should be trivial to adapt to your needs....

0 Kudos
Message 10 of 26
(5,444 Views)