01-02-2018 03:25 AM - edited 01-02-2018 03:41 AM
Maybe something like this?
The LED will be on if the button is held down for more than 5 seconds.
(of course the time display is optional).
01-02-2018 04:23 AM
@altenbach wrote:
Maybe something like this?
The LED will be on if the button is held down for more than 5 seconds.
Alternatively, you could just use Elasped Time and have the timer reset when the button is FALSE (use a NOT).
01-02-2018 04:47 AM
Any suggestion without while loop and high resolution vi..
I am continuosly taking Boolean value from hardware and high resolution vi is password protected..have you gone through my previous program ..
Previous program explanation :- it will detect the falling edge happen within 5 sec if my falling Boolean is true...
01-02-2018 06:19 AM
@RNR wrote:
high resolution vi is password protected
I don't see what that has to do with anything. It is a built in function that is readily available. Just use it to get a relative time.
@RNR wrote:
Previous program explanation :- it will detect the falling edge happen within 5 sec if my falling Boolean is true...
So you are looking to see if a pulse is less than 5 seconds? You can use the same concepts Altenbach already gave you. When you detect the rising edge, store the relative time in a shift register. When you detect the falling edge, you just subtract the current relative time from the time you stored in the shift register.
01-02-2018 10:44 AM - edited 01-08-2018 10:27 AM
@RNR wrote:
Any suggestion without while loop and high resolution vi..
I am continuosly taking Boolean value from hardware and high resolution vi is password protected..have you gone through my previous program ..
Don't be ridiculous. To continuously "take" a boolean, you need a loop and there is no basic difference if the data comes from a front panel button or an instrument. That's what loops are for!
You need to take relative times and if you don't like high resolution relative second, you can substitute "tick count" or "get date/time in seconds". Same difference after you account for the units (ms vs s).
@RNR wrote:
Previous program explanation :- it will detect the falling edge happen within 5 sec if my falling Boolean is true...
I showed you how to start or reset a timer depending on conditions and keep track of the elapsed time between the events. You can substitute any other conditions and comparison logic you want, so modify as needed.