Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Oscilloscope measurment (Tektronix TDS 2024)

Hello everybody

 

My setup:

- a Tektronix AFG3022B Function Generator

- a Tektronix TDS 2024 Oscilloscope

- LabVIEW 2009

 

The Task ^^:

The function generator controlls (sinus curve with different frequencies) a LED which illuminates a fluorophor-coated glass slide. The light is then analysed by a photodiode and the data is being send to the oscilloscope (source 1 is reference from the function generator, source 2 is signal from diode). The aim would be to calculate the phase shift / time difference between the two curves.

 

What I've done so far:

I can controll both instruments via USB by using their specific instrument libraries. I wrote a programm which sets the function generator to a certain frequencies and analyses the oscilloscope data with the "tone measurement.vi" (I get the phase from both sources and can calculate de difference). As I had some problems with the oscilloscope's averaging function (see below), I inserted a shift register which stores 8 measurements and then calculates the mean value.

 

Although my programm "works", I've got some questions about the whole controlling... Hopefully, you can give me some hints / ideas how I can write a better version...

 

- As my signal is noisy, I used the oscilloscope's averaging function. However, if I set the instrument to averaging and start a LabVIEW measurment (acquire multiple waveform), it disregards my previous entry and starts with direct sampling. How can I change this?

- Each time I start one of the VIs from the instrument library, the oscilloscope beginns with an auto-setup. However, if I make 8 measurments in a row, it does the setup again and again, which takes quite a lot of time. Can I deactivate this somehow?

- Is there a way to controll how long a measurment should take? A single "aquire mulitple waveform"-scan, where I get only one sample, takes about 10 seconds...

- I truly don't think that the "Tone Measurement" is the best way to get the phase... Is there another .vi?!?

 

Hmm, I just realised that it's not so easy to describe my problems. Hopefully, you understand what I mean. Otherwise, please don't hesitate to aks! Maybe, you got a completely differnent approach in mind... For me at the moment, the easiest thing would be if I could tell the oscilloscope one by one which button I would like to press right now ^^

 

For a better understanding, I attached the VI I used for setting the averaging number (the one that is ignored each time I start another measurement), as well as my current VI...

 

Looking forward to receiving some interesting inputs Smiley Happy

 

Cheers and thanks in advance for any help,

  Reepicheep

Download All
0 Kudos
Message 1 of 5
(6,119 Views)

There is no place in the code where you are calling the function to set the averages. If you are doing something as silly as manually setting it, then of course this is being ignored since you are resetting the scope. Add the  Configure Acquisition Type function and move all configuration functions outside the loop. It makes no sense to reset and set channels/timebase repeatedly.

0 Kudos
Message 2 of 5
(6,089 Views)

Hey Dennis

 

I'm sorry, I just got back to LabVIEW after not using it for about two years...

 

However, you were right of course about the reset off the channels. It makes absolutely no sence to have this functions within the loop... So that problem is solved, thanks for your help there!

 

But about the averaging function: I know that it was not included: I took it out because I never so an influence to the data...

 

I attached a revised version off the programm. The problem is still: If I collect the data manually with the oscilloscope (using averaging), I receive very stable curves. If I do the measurement with the programm, the shift differs by more then 20°.

(The loop/averaging is only for me to controll if the collected values are in the same region, which unfortunately is not the case yet)

 

As I didint know where the best place would be to insert the "Configure Acquisition Type.VI", I posted it again and again after each configuration step... I know, that's not good looking at all, but I just wanted to see if I get any result-improvement. But nothing so far...

 

Hope, this looks better to you and I didn't make another obvious mistake as in the previous programm ^^

 

Cheers

 

0 Kudos
Message 3 of 5
(6,057 Views)

Short note: If I adjust the "timebase"-value to 0.01, it improves my output. However, the values still differ by more then 10°...

0 Kudos
Message 4 of 5
(6,053 Views)

Nothing? Nobody? Smiley Sad

0 Kudos
Message 5 of 5
(5,992 Views)