LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Preventing a determined sample from being saved into the file.

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

 

 

 

 

0 Kudos
Message 1 of 6
(2,546 Views)

Hi

 

Which driver do you use for the scope, and which kind of scope is?

Also attach the subvi

 

Cheers

0 Kudos
Message 2 of 6
(2,526 Views)

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

0 Kudos
Message 3 of 6
(2,523 Views)

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.

 

 

0 Kudos
Message 4 of 6
(2,521 Views)

Because simply downloading your code are missing....

you shoul organize all in a dll Smiley Happy

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

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.

0 Kudos
Message 6 of 6
(2,506 Views)