05-12-2016 04:47 PM
This treats it like a hand dryer.
05-12-2016 04:49 PM
I just started to learn the language so for now nothing is trivial but thanks for you r help.
05-12-2016 04:57 PM
I think I didn't explained myself correctly. I attached a Vi I found, what I want it to do is like this: let's say the user put the timeout1 (detection time) on 150 and the timeout2 (time without detection) on 100..If the user press the button the timeout1 value is running until it get to 150 and stops there, becuase we get to the timeout1 the led turn's on. Releasing the button will cause the timeout2 value to run untill 100 and then the led goes off. this is what I need using the Vi that is attached, I think it is just some modifications to it but I am new to LabVIEW so I appriciate all the help I can get.
TNX
Guy
05-12-2016 05:08 PM - edited 05-12-2016 05:09 PM
This code here meets your requirements and is a lot simpler to read (no case structures!). What I have here is using a Feedback Node to keep track of the previous value of the button. So when the value changes (the Not Equal), the Elapsed Time function resets. I also added a Select so that you can have two different times, one for turning on and another for turning off. When the target time has been reached, the Time has Elapsed output will go to TRUE. With the select, I choose to use the current button's value for the LED output. When the time has not elapsed yet, I use the previous value of the LED output (stored in the Shift Register).
05-12-2016 05:32 PM
TNX , I want to do it with the way like in the file attached but I will look at what u sent back at home.
Appriciate your help 🙂
05-12-2016 05:42 PM
@GuyGor wrote:TNX , I want to do it with the way like in the file attached but I will look at what u sent back at home.
Why are you attaching the same file twice? Once is sufficient!
05-12-2016 06:01 PM
Just because I like throwing things out beside Cross. My version of the tap, without using that fancy elapsed time express. Although the event structures probably make life a little more complicated again.
05-12-2016 06:08 PM
Also, just after looking back through your code, you do realise that:
is exactly the same as
Just a little semantics thing I thought I should mention.
05-12-2016 06:18 PM
Just for completeness, here's another event based extended version of my earlier post.
(Some extra code was needed for the case where the user releases the button before the LED goes on)
05-13-2016 03:28 AM - edited 05-13-2016 03:33 AM
Altenbach , please don't help me anymore . You seems to be very angry with me and for no reason at all. I am new at this forum and new to this Labview world as well, try to act appropriate.