MATLAB does not read the data correct from the Oscilloscope

7 visualizaciones (últimos 30 días)
Nikan Fakhari
Nikan Fakhari el 20 de En. de 2022
Comentada: Cristhian Zárate el 22 de Jul. de 2022
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 comentario
Cristhian Zárate
Cristhian Zárate el 22 de Jul. de 2022
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

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by