LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

verify if data out of range from a oscilloscope

Solved!
Go to solution

Hi !

 

I'm designing an application for which I need to measure short pulses, so I get a waveform from a scope, and i need the range of the scope to adapt regarding on the value of the pulse (so if the range is'nt adapted, I delete the waveform, reconfigure the oscilloscope with a bigger range, and send the pulse again). But I want all of it to be automatic, so the application have to find if the range is ok or not by itself.

 

I use this little subVI to detect a saturation (= data out of range), but it detects a saturation rarely ever. So what do you think is wrong with it ?

 

rangeSaturation.jpg

 

thanks a lot 🙂

 

0 Kudos
Message 1 of 12
(5,908 Views)

_zeyol_,

 

Most scopes can be queried for errors and warnings.  An over range or clipping condition should generate an error or warning.  I would think that that would be the quickest, most efficient method of detecting a problem.

0 Kudos
Message 2 of 12
(5,902 Views)

thanks for that quick answer.

 

The scope I'm using is a agilent MSO6104. I querry it for errors after each measurment and it doesn't return anything, that's why I tried to do it by myself.

0 Kudos
Message 3 of 12
(5,890 Views)

Is there a seperate command for warnings?

0 Kudos
Message 4 of 12
(5,879 Views)

Hi,

 

comparing dbl values for equality may not work as expected due to the way these numbers are represented in the binary world of computers.

Maybe you can check if adjacent points are very similar instead? Before your loop you could multiply your array by say 10^12 convert it to i64 and then check for equality.

 

Also I'd recommend adding an abort condition to your for loop, get rid of the local and just wire the result of >=5 to your condition and to "flag" outside the loop.

 

Regards

Florian

0 Kudos
Message 5 of 12
(5,871 Views)

"Is there a seperate command for warnings?"

 

no, there's only "error querry", and I had a look in the configuaration VIs, nothing seems to be used for warning or over range detection

 

Florian.Ludwig, I didn't thought about this, it could explain why it work some times but often not ! I'll try it

0 Kudos
Message 6 of 12
(5,870 Views)

I did a similar test for this condition quite easily, however, it was for a TEK scope.

 

I download the data in unsigned word format, then scale it to its correct values. So if any data is 0 or 65535, then it is likely that part of the data is out of range. (It is also possible that it is at the very limit of its range.) See attached snippet.

 

Cheers,

mcduff

 

OverflowTest.png

0 Kudos
Message 7 of 12
(5,853 Views)

I like you're solution, but I don't really get your code...

 

what do you mean by "scale it to its correct values" and how do you do it ?

0 Kudos
Message 8 of 12
(5,843 Views)

I do not know how you are downloading your data from your scope. Scopes are typically 8 bits of precision, although when they average data the effective bits can increase.

 

So the data on the scope screen is typically an array of values from 0 - 255, (8 bit), possibly greater if someone averages the data, 0 - 65535. To get the real values in volts, you just do a linear transformation, ie, y = mx + b.

 

So in my program, I download the voltage values as an array of 16 bit words, in case someone decided to average the data. Along with that data, there is a header. The header contains a voltage offset, b in the equation above, and a scaling factor, m, in the equation above. Multiply and add the values to the array and you get an array of real voltage values. Also contained in the header is a starting time, a time increment, and the number of points. You can use these values to create the time array if it is needed.

 

The added advantage of downloading the data in this manner is that it is faster than downloading the values in ascii format.

 

So I would say, look at your program and see how the data is being downloaded.

 

 

Attached is a snippet from a program that converter the header and bytes from a HP54845A scope, I do NOT know whether your scope has the same format or not. But here is a description of what it is doing.

 

The data and header are combined in one data stream; earlier in the program I removed any ascii descriptions from the header so only numbers and a byte stream are being downloaded. The header data are parsed, and the byte stream is converted into signed 16bit integers in this case, then converted to real voltage values.

 

ByteConverter.png

 

 

Hope this makes sense as I will be out of the office for a while and unable to follow up.

 

Cheers,

mcduff

0 Kudos
Message 9 of 12
(5,833 Views)

I download the data of the scope using its drivers, so I get a waveform, from which i can extract the table of float values. so I don't have access to the digital values

but thanks for the explanations 🙂

0 Kudos
Message 10 of 12
(5,810 Views)