From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

How to turn on the LED when a threshold is reached and turn off only when the value doesn't reach the threshold for a certian time?

Solved!
Go to solution

Hi, I want to write a program that can light up the LED when a value reach it's threshold, and only when the value doesn't reach the threshold for a certain time, let's say 5 second, then the LED will turn off,otherwise it will remain. How can I achieve this in labview?Can someone help me? Really thanks !

0 Kudos
Message 1 of 3
(2,677 Views)
Solution
Accepted by topic author winnie11

I guess you're using a while loop to keep the value updated.

Add a shift register to your while loop initialise it with a U32 (time in ms)

Add shift register to your while loop which keeps the previous value of your bool

WHen your value reaches the treshold => turn light on and put current time into your shift register.

In the next iteration of your loop check wether value is still above treshold

=> Y => was previous value true?

    => Y => next iteration

    => N => turn light on and put current time into your shift register.

=> N => substract current time minus time in shift register => bigger then 5 secs?

    => Y =>  Keep light on

    => N => turn light of

 

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 3
(2,673 Views)
Oh,I think I understand what you mean.I will try it,thank you!
0 Kudos
Message 3 of 3
(2,657 Views)