05-14-2013 03:22 AM
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 !
Solved! Go to Solution.
05-14-2013 03:56 AM
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
05-14-2013 07:10 AM