I have solved my problem.The unsuccessful read is due to data acquisition. Be careful in the DSO1012A the :RUN and :STOP command is used for acquisition while in this example the :DIGITIZE CHAN1 command is for date acquisition.
Anyone try this m file on Agilent DSO1012A oscilloscope?
After successful connection between my oscilloscope and Matlab, I runned the m file, but failed.
I stepped the programming and found the problem occurs at binblockread function.
The error meassage is
Warning: Unsuccessful read: A binblock is not available to be read.
Accoridng to the comments
I also tried changing line 76 from:
waveform.RawData = binblockread(visaObj,'uint16'); fread(visaObj,1);
waveform.RawData = binblockread(visaObj,'int16'); fread(visaObj,1);
and also to
waveform.RawData = binblockread(visaObj); fread(visaObj,1);
But the error also occurs .
I dont konw if this m file is compatiable with my DSO1012A oscilloscope? Could anyone give me some suggestion to resolve this problem? Thanks in advance.