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
(3,013 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
(3,009 Views)
Oh,I think I understand what you mean.I will try it,thank you!
0 Kudos
Message 3 of 3
(2,993 Views)