01-19-2016 07:34 AM
Hello,
I have a general question reagrading types and waveform. I constantly encounter this problem.
I'm controlling an oscilloscope via GPIB connection. everything working fine except the data represnetation.
I generate waveform display by connecting a bundle to a waveform chart. the bundle accept initial value, increament and y-axis array data.
the data received in a binary string form, each number represented by 16 bit.
I convert the string from binary to unsigned bit and than type cast it to I16 before sending it to a waveform chart.
if my signal on the scope is between -1.5V to 1.5V - the waveform chart shows about -1,500,000,000 to 1,500,000,000. it is seem to get correct number I need to normalized it by 2^14.
I've tried different representations like SGL, I32, with or without swapping the high and low byte and I don't get something close to 1.5 values....
can someone explain why? and how to overcome this (other than doing normalization - which just does'nt seem right).
01-19-2016 07:37 AM
Can you post an example VI with some sample data, the conversion you are doing, and the output you expect to see? Then we can see what you're doing and try to help.
01-19-2016 07:40 AM
01-19-2016 08:21 AM
attached screen shots of the waveform read function.
please ignore the x-axis.
the oscilloscope is Lecroy DDA120.
as I said, I read a binary string and convert to I16 array for input to the waveform.
the real signal is -1.5V to 1.5V. the waveform shows about 2^14 factor of it.
why?
01-19-2016 08:26 AM
If the device is returning I16 data - then these numbers are integers so you cannot have a value of 1.5V. You need to multiply/divide the I16 by a scaling factor (probably from the device manual) to convert to floating point voltage values.
01-19-2016 08:30 AM
the device returns the data in binary form. each number as 16 bit.
what is better to use than I16 in this case?
01-19-2016 08:34 AM - edited 01-19-2016 08:42 AM
Yes, the device returns the unscaled values as a 16-bit integer which you seem to be doing correctly. You then need to scale the values according to the device manual to convert the numbers into engineering values in volts.
Edit: The device manual or programming interface guide will give you all of the necessary data on how to decode the binary data into the actual data. The manufacturer's website doesn't list the manual for that exact part number but in one of the ones I read it mentions that there is some header data when using the WAVEFORM command which includes the VERTICAL_GAIN, VERTICAL_OFFSET and VERTICAL_UNIT which you can use to scale the data correctly. e.g. page 56 of this manual.
01-19-2016 08:44 AM
01-19-2016 08:45 AM