LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure Analog output/input time difference?

Hi I was wondering if there is any way of measureing the time difference/delay between my analog output and input. The output is sent to sent to a transmitter which in turn sends the signal to a receiver ( the distance between these two results in a time delay) which is then the analog inpout into my DAQ.

 

Attached is the vi I am using to transmit and capture a sine wave. 

 

The time difference is expected to be rather small (milliseconds)

 

Regards

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

Hi there,

 

Yes, there is.  The analog output waveform and the analog input waveform both contain timing data.  See attached.  Since I hate the Express VIs, I've written the code to reflect what you would see if you right-clicked on the Express VI and selected "Open front panel".  Since I never use the Express VIs, I also never use dynamic data, so I've generated your sine wave using the "Generate analog waveform" functions instead.

 

I've added comments to help you understand what I'm doing here.  Before I write the analog waveform to the output channel, I set its start time (t0) to the current time.  Then when I read the analog input, I extract its start time.  The difference between when the analog output generation started, and the analog acquisition started, is simply the difference between these two times.

 

If you want the difference between when the analog generation ENDED, and the analog acquisition started, you can do that too...you know the analog generation start time, you know your sampling rate (and therefore the delta T between points) and you know how many points you wrote for each iteration.  So figuring out the end time should be pretty easy for you.

 

You will probably need to play with this in order to make it do exactly what you need...this is just to point you in the right direction and not meant as a drop-in replacement for your code.

 

Hope this helps,

d

Message Edited by DianeS on 02-07-2010 02:09 PM
Message 2 of 4
(2,740 Views)

Diane S,

 

I have only ever used express vi's, I am undertaking alot trying to make LabVIEW preform what I need for a college project so it is all entirely new to me. I am willing to put as much research and hours as I can to do this. I am hugely grateful (+kudos) for the effort you have gone through to help me and I will take on board all your advice and help. 

 

I think it's time I moved on from express vi's. 

 

 

0 Kudos
Message 3 of 4
(2,732 Views)

Hello again,

 

Have you taken any of the online LabVIEW tutorials?  Those will help you a  lot.

 

LabVIEW 3 hour Tutorial

LabVIEW 6 hour Tutorial

 

Also, look at the DAQ examples that ship with LabVIEW...those will help with your understanding too.  I agree, it's time to move beyond the Express VIs!  One thing you can do, that I mentioned earlier, is right-click on your Express VIs and select "Open Front Panel".  Then you'll be able to see what's going on in there.  I think that the shipping examples will be more helpful for you, though, since they are well commented and the innards of the Express VIs aren't.

 

Good luck!

d

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