LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I keep track of when a signal hits a certain voltage?

I am fairly new to Labview, and I am having trouble with the following.  I am working on replacing a Digital Vector Filter with Labview software.  I have a rotating shaft with eccentricities, which are measured by X and Y proximitors.  Also, a keyphasor voltage keeps track of the rotation rate, which enables me to relate X and Y to each other. Essentially, I have to find when the keyphasor voltage hits -11 volts, and keep track of when that happens, then, keep track of the next time that happens, in order to get the time it takes for one revolution. I don't know if this makes a difference, but the data is coming in as dynamic data.  I want to be able to tell the user what the rotational rate is as the program is running.

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

Can you post your code?  It always helps if we can see what you are talking about.  From what I gather from your post, you simply want to record the voltage when it hits -11V, start a timer, then stop it when it hits -11V again (1 revolution).  Is this correct?  For timing, you can use the Elapsed Time Express VI.  Trigger it on the first instance of -11V, use a functional global variable to store your voltage, and compare your FGV contents against new measurements until -11V is read once again, and read the timer, then reset it. 

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 2 of 4
(2,149 Views)

Hi aem64,

 

Without seeing your code, I can't tell you exactly what to do.Anyway I have made an example vi which does a voltage checking and gets time of rotation. Check out the attached VI. It's just a simulation and so the results may not be absolute. But you can get an idea of how to do that for sure.

Regards,

Nitzz

(Give kudos to good Answers, Mark it as a Solution if your problem is Solved;)) 

Message 3 of 4
(2,136 Views)

Thanks for the help!

 

I have taken the vi you gave me and changed it to a bit.  The voltage going in is being sampled rather quickly, and thus there is no actual point that equals -11 Volts. I want to do something like the following: Check timer time, tm, and check:

if tm-1 > -11 Volts   and tm < -11  

 

do the following calculation to get the actual value time that voltage crosses -11 Volts, tk.

 

tk= (tm-1) + (  (tm- (tm-1)     ) / ( Km - (Km-1)  ) )  *  (-11-(Km-1)),      where Km is the voltage at tm.

 

 

I want to be able to do this streaming, to show the user what the tk value is live.  The only times I really need to save are tm and tm-1, from there I can save all the tk's in an array for further analysis.
Please let me know if this is possible.

 

Thanks 

Download All
0 Kudos
Message 4 of 4
(2,113 Views)