From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count Boolean changed

Solved!
Go to solution

Maybe something like this?

 

ElapsedTRUE.png

 

The LED will be on if the button is held down for more than 5 seconds.

 

(of course the time display is optional).

 

 

0 Kudos
Message 11 of 15
(929 Views)

@altenbach wrote:

Maybe something like this?

 

ElapsedTRUE.png

 

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).


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 12 of 15
(918 Views)

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...

0 Kudos
Message 13 of 15
(917 Views)

@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.


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 14 of 15
(903 Views)
Solution
Accepted by topic author RNR

@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.

0 Kudos
Message 15 of 15
(883 Views)