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: 

DAQ voltage threshold for a specific time

Solved!
Go to solution

Hi,

 

Being a newbie to Labview, I'm finding it a little bit hard to get things done.  Here's what I want: I'm acquiring voltage values from a voltage source through DAQ in a while loop. Once the voltage reaches, say 4.8V, I want it to remain above 4.8V for a specfied time, say 5 seconds. If it does, I will perform some action. Until this happens, I will keep sampling the values. I had a look at some examples but none of them do what I intend to do. . Can someone also point me to where I need to look for similar questions in future?

0 Kudos
Message 1 of 4
(2,637 Views)

One thing you could do is put a shift register on the acquisition loop. Inside the actuisition loop, if the input value from the DAQ is less than the threshold, write the current time in seconds to the shift register. If the input value is above the threshold put the old value back into the shift register and subtract the contents of the shift register from the current time. If the difference is greater than 5 seconds, do what you need to do next.

 

Mike...

Message Edited by mikeporter on 02-11-2009 11:55 PM

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 4
(2,608 Views)
Solution
Accepted by topic author Yashwant

Not to argue with mike (who is far better at this than me), but here is how I would do it....  where the Take Data vi is where you get your data...

 

-Matt

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 3 of 4
(2,605 Views)

My sincere thanks to both of you. I could do it using the method that Matt described as I thought that was easy. Please find how I did it in the attached file.

 

-Yashwant

0 Kudos
Message 4 of 4
(2,579 Views)