AnsweredAssumed Answered

MSO7104A: acquiring signals with ':DIGitize'

Question asked by fer_diablo_rojo on Oct 15, 2009
Latest reply on Oct 30, 2009 by dnt
Hi! I'am trying to interface MSO7104A digital oscilloscope to my computer using
Matlab. Everything it's okay until i tried to acquire the data from any of the four analog channels.. I can't get the data..
this is my code..  i could read or modify everything in the scope. the only problem is acquiring the channels..


%% Create a VISA-USB object.
oscilo = instrfind('Type', 'visa-usb', 'RsrcName', 'USB0::2391::5973::MY48260590::0::INSTR', 'Tag', '');

% Create the VISA-USB object if it does not exist
% otherwise use the object that was found.
if isempty(oscilo)
    oscilo = visa('AGILENT', 'USB0::2391::5973::MY48260590::0::INSTR');
else
    fclose(oscilo);
    oscilo = oscilo(1)
end


%%


% Connect to instrument (me conecto al osciloscopio).
fopen(oscilo);
fprintf(oscilo,':AUToscale');
  
fprintf(oscilo,'TRIGger:SOURce CHANnel1');
  
    %mido amplitud canal 1
    fprintf(oscilo,':MEASure:SOURce CHANnel1');
    fprintf(oscilo,':MEASure:VRMS?');
    vrms= str2num(fscanf(oscilo));
   
    %Adquirir señales del canal 3
   
    fprintf(oscilo,':ACQuire:TYPE NORM');
    fprintf(oscilo,':ACQUIRE:COMPLETE 100');
    fprintf(oscilo,':DIGITIZE CHAN3');
    fprintf(oscilo,':MEASURE:SOURCE CHANNEL3');
    fprintf(oscilo,':MEASURE:FREQUENCY?');
    fre=str2num(fscanf(oscilo));
   
   
   fprintf(oscilo,':WAVEFORM:SOURCE CHAN1');   
   fprintf(oscilo,':WAVEFORM:FORMAT WORD');
   fprintf(oscilo,':WAVEFORM:POINTS 1000');
  
fprintf(oscilo,':DIGitize CHAN1');
   
data = query(oscilo,':WAVEFORM:DATA?')

waveform_size=5000;
    
fprintf(oscilo,':WAVEFORM:PREAMBLE?');
pream=str2num(fscanf(oscilo));
  
  
fprintf(oscilo,':RUN');
  
fclose(oscilo);



Thanks!!!
Fernando.  

Outcomes