필터 지우기
필터 지우기

MATLAB does not read the data correct from the Oscilloscope

조회 수: 3 (최근 30일)
Nikan Fakhari
Nikan Fakhari 2022년 1월 20일
댓글: Cristhian Zárate 2022년 7월 22일
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개)

Community Treasure Hunt

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

Start Hunting!

Translated by