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: 

waveform averaging results using labview from O-scope

Solved!
Go to solution

Hello Fellow Engineers! I am a first-yeargraduatestudent in CHEE at University of Houston. I basically know nothing about labview. I am trying to program an application which is as follows-I collect a signal waveform from O-scope. This waveform doesn't change its characteristic shape. I need to find the average waveform from N waveforms (say 100). So,the slight changes (or noise) in the characteristic shape over the period mustbeaveraged out and I need to have a resulting waveform, which represents the average waveform over a period. So, basically, I'm collecting the waveform multiple times (say 100) over a single period. The O-scope I am using now is Tektronix TDS 2024B. It communicates with computer through USB. The labview version is 8.5. For now, I am able to communicate with computer using our o-scope through labview. I already downloaded the instrument driver from your website. It turns out that the program can only give me the average result which I can get directly from o-scope manually. I need to have more averaging (say 100) by using labview.I wrote a program which is based on the instrument driver that is downloaded on your website (For loop part is for average the waveform). The instrument driver and program I modified are attached. The program cannot be fully opened if the driver is not put in the right place in the labview ( under /inst lib.) When I run the program, the averaged waveform doesn't show on the front panal and waveform signal file isn't being recorded correctly. Is there anyone can find where I did wrong and elaborate it to me? Since I barely know Labview, it will be even better if you can add some image or program you modified. I await your creative ideas.
 
With warm regards,
--
Weiye

0 Kudos
Message 1 of 26
(3,904 Views)

I don't understand why you don't simply command the scope to take the averages.

 

In any case, your code does not make any sense. You take a single reading and then pass it to a for loop. That looks like you are trying to average a single reading.

0 Kudos
Message 2 of 26
(3,888 Views)

Thank you for your instruction. I am a beginner in Labview and I am trying to learn.

I need to get more average from labview besides the average from the scope. For example, I need to average (say 100 times) the waveform  which is averaged by o-scope. Can you show me how can I do that? Thanks.

0 Kudos
Message 3 of 26
(3,883 Views)

There is a function called Configure Number of Averages in the library you attached. I don't know why you have the configure function from a different driver in your code. The Configure Number of Averages has an input that you set 'Number of Averages'. Pretty simple. You can set the number of averages from 2 to 512 in powers of 2. In other words, 2,4,8,16,32,64,128,256,512. This is explained in the description of the function and for the front panel controls.

 

If you really insist an doing it yourself, place the shift register on the main loop. Add the new waveform to the old. Use the Mean function and write this back to the shift register.

 

Your fundamental error with your existing code (besides attempt to average a single waveform) is that you are trying to do an add with an empty array. Add an array with data to an empty array and you get an empty array.

0 Kudos
Message 4 of 26
(3,878 Views)

Thank you so much! I found Configure Number of Averages in the function library. As I said, I am a beginner....I tried to replace the configure function I used right now with this" Configure Number of Averages". But how can I connect the VISA resource to instrument handle? It gives error saying that I wired different RefNum. Can you explain to me what should I do?

0 Kudos
Message 5 of 26
(3,871 Views)

What I would have done is replace the function you had with the Configure Acquisition Type and insert the function for acquisition number. I did that and had no error except having to rewire the number of acquisition averages control. You should post your code for someone to see what is wrong.

0 Kudos
Message 6 of 26
(3,866 Views)

I still cannot figure out how to connect that "Configure number of averages" into my code..Can you, or anyone else help me out?...

0 Kudos
Message 7 of 26
(3,858 Views)

Sorry, right next to the 1000/2000 instrument palette is one for the TDS3000 on my installation. That was where I saw the separate function for setting the number of averages. You pulled in the IVIScope function. All you need to do is wire the control to the input of the Configure Acquisition Type and delete the IVI function.

0 Kudos
Message 8 of 26
(3,855 Views)

Sorry, I didn't understand what you said..Which iviscope funtion I shall pull in? where can I wire the control to the input of the Configure Acquisition Type? And delete what IVI function? You mean I need to replace the" configure number of averages" with" iviscope configure acquisition type" in my code which I attached before?.. Can you attach what you modified? I'm not familar with the terms in labview you wrote..Sorry for the lack of knowdlege, I just start learning Labview a week before..

0 Kudos
Message 9 of 26
(3,851 Views)