MATLAB does not read the data correct from the Oscilloscope

3 次查看(过去 30 天)
Hi there,
Recently I have had issues with the binblockread function in matlab.
I am trying to read a waveform from a oscilloscope, I can clearly see the waveform on matlab, however the voltage
values are printed incorrect. I am using an int8 for the precision.
I was wondering is there any scale conversion exist here that I am unware of?
I would highlty appreciate some help on this,
Thank you very much
Nikan
  1 个评论
Cristhian Zárate
Cristhian Zárate 2022-7-22
Hi Nikan,
Usually, in the programming manual, you have the documentation of how to read the data from the instrument.
For example:
" The read data consists of two parts - TMC header and data packet, like #900000ddddXXXX..., among
which, “dddd” reflects the length of the valid data packet in the data stream, “XXXX...” indicates the data
from the data packet, every 2 bytes forms one effective data, to be 16-bit signed integer data "
Assuming you alread read the preamble, next you read the data
adc8bit_data = binblockread(scope_obj, 'int16');
Then, you process the adc data as found in the manual...
i). the channel voltage -
channel voltage = ( channel ADC data / 6400 - channel zero offset) * channel volt scale
Note: ADC Data = waveform data, or Vmax, or Vmin, or Vavg (16-bit signed integer data)
In case you don't have any information use the following walk-around
Find the value of "factor" until you get what you see in your oscilloscope screen. You can do it so by applying a 1Vpp sine waveforme.
waveform_data = (adc8bit_data/factor - vertical_offset)*vertical_scale
It would helpfull to know the brand and model of your oscilloscope.
Cris

请先登录,再进行评论。

回答(0 个)


Translated by