LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time of flight

I am having trouble developing a VI that would allow me to measure the delay from the start of my program to when I receive my signal. Basically, what I am trying to do is start a timer of some sort at the beginning of my program and when the threshold detector says a signal is detected the time elapsed would be recorded and the value pass into a variable. I need to perform this at least twice and save both values into separate variables so they can be used in an calculation.

 

Thanks.

0 Kudos
Message 1 of 4
(3,630 Views)
With what kind of resolution? What kind of hardware are you using? Do you have any code to post to show at least something you have done?
0 Kudos
Message 2 of 4
(3,629 Views)

Agreed w/ Dennis, a bit more info would be amazing.

 

To get started though, there are a few ways to time execution in LabVIEW. The first would be using the Get Date/Time VI to snag the time at startup and again at another point in the code. A little simple subtraction and you've got your execution time.

 

Note: This time is pulled from the System Time which Windows updates at about 60 Hz giving your a resolution of only ~15 ms.

 

Another method is counting the clock ticks that happen about 1 ms apart. This will increase your resolution a bit and require less conditioning of the data coming in. A great example of this can be found in the Developer Zone here.

 

Cheers!

 

Logan

National Instruments
Applications Engineer
Message 3 of 4
(3,585 Views)

I would be using a self made amplifier, filter, and envelope detector circuit that would be attached to the elvis board, feeding the signal into the code. The signal would enter the elvis board at about 50kHz, so the resolution I need would be in the microseconds. I have attached the code I have so far. I have the acquired signal converted into an array and sent into an "insert array" and threshold function. I guess the way it is so far would not work the way I want it to. The get date/time vi sounds interesting. But how would I be able to hold the data obtained for my first run? Because I would need the data held until after my second run, then both values would be sent into a formula node for calculation. the variable 'dc' would be a user input from the start, 'T' is the first value, while 'tw' is the value obtained from the second run. For the threshold VI, I am confused as to the units that I should be using, I have assumed that the values would always be read as volts and not mV or uV, etc.

 

Thanks. 

 

 

0 Kudos
Message 4 of 4
(3,547 Views)