10-15-2010 07:38 AM
Hey guys,
my program controls an arbitrary waveform generator, performs a frequency sweep and returns amplitude and phase Bode plots. It also controls the amplitude range of the acquisition: if the peak-to-peak of the output signal lies between 5V and 10V, the range is set to 10; if between 2 and 5, the range is set to 5 and so on. I do this in order to keep the accurancy but it has a problem that I will explain with an example:
The program runs one interation and calculates a peak-to-peak of 5.00, so it sets the range to 10 as mentioned above. If in the next interation the measured peak-to-peak is less than 5.00 (3.00 for exemple), the program will sample this signal with a range of 10, which will cause a poor resolution and therefore generate a bad sample data. The range will be set to 5 only in the next iteration. How can I prevent this bad sample to be saved into the file? (see attachment)
Just to summarize, I have to discard the sample whenever the range changes.
If the signals I'm working with were not well-behaved this could happen too often and I could lose too many samples but with Piezos this is not the case.
I'm sorry if my program is not well readable.
Thanks in advance,
Lucas
10-18-2010 07:51 AM
Hi
Which driver do you use for the scope, and which kind of scope is?
Also attach the subvi
Cheers
10-18-2010 08:01 AM
Hi alesei!
I use a Tektronix AFG 3022B with the last drivers from Tektronix web site.
There are a lot of sub VI's for this instruments (initialize, configure, close etc.). I don't understand what exactly you want me to attach.
Cheers
10-18-2010 08:07 AM
Hey Lucas,
you just want to remove those "bad" samples before write into measurement file?
Your program is really hard to read .. Is there a steady behavior in your iteration? So place a Case Structure around it and just carry out samples if your range is right. Where exactly you iterate in your program?
Maybe you can work with array operations to find the bad samples in you array and remove it before your writing into file.
10-18-2010 08:18 AM
Because simply downloading your code are missing....
you shoul organize all in a dll
10-18-2010 08:29 AM - edited 10-18-2010 08:30 AM
Hey alesei,
you can download drivers here:
"Tektronix AFG3022B"
<http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=11268>
If you install these datas no SubVIs are missing.