LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

switch with debounce

Solved!
Go to solution

Hi everyone,

 

I need to make a switch that does the following when clicked:

 

1- switch on

2- wait for 60 ms

3- switch off

 

i am new to labview so anything would help.

 

Thank you 

0 Kudos
Message 1 of 7
(5,444 Views)

Hi Shahramk6

 

U can use aciveX control for it (if u really need this bounce logic to be in control), else u can program the logic such that , once the switch is pressed after 60 sec changing its property to off

0 Kudos
Message 2 of 7
(5,415 Views)
Solution
Accepted by topic author shahramk6

Use a Boolean control with "Switch When Pressed" mechanical action and a local variable (resetting it) in the Timeout case of the Event structure.

 

snip.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 7
(5,383 Views)

LOL sounds like you did someone's homework.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 7
(5,361 Views)
Solution
Accepted by topic author shahramk6

If this is homework, you shouldn't use Local Variables (read this post to understand when to, and when not to, use them).  Here's a way to do it without locals:

snip.png

 

You can probably figure it out for yourself, but the string constant contains "\01\01\00\01\01\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00".

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 5 of 7
(5,332 Views)

I accept risking losing the solution and kudos by posting this, but my second post in this thread was intended for the entertainment of experienced LabVIEW programmers; it is intentionally obfuscated.  I apologize for making you the butt of my weak joke.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 7
(5,279 Views)

@jcarmody wrote:

I accept risking losing the solution and kudos by posting this, but my second post in this thread was intended for the entertainment of experienced LabVIEW programmers; it is intentionally obfuscated.  I apologize for making you the butt of my weak joke.


I really hope this is the solution handed in.  That being said I think you'd get more kudos for posting obstruficated code.  If you answer for the OP you get one kudo for each post max.  If you post obstruficated code you likely get kudos from your peers that think it's funny.

0 Kudos
Message 7 of 7
(5,264 Views)