Hi every one, I have this testetd on a MSO9254A and after few modifications works fine.
I'm building a complete matlab GUI suite for fast testing, but I'm unable to capture data from the digital analyzer.
I've look over the internet but I didn't find a matlab script or other language for this task.
does any one know an example code for Logic Analyzer capture?
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.
Folks trying this with 2000/3000 series scopes - if you get errors such as "undefined header" that is likely because the scope does not support the SCPI command. Please refer to the programmer's manual for the scope for the exact SCPI commands for your oscilloscope and use that to replace the offending commands in the script.
"Data out of range" typically is because you are trying to set a value, such as timebase, that the scope is not capable of. Again - modify the parameter to a value supported by the scope.
An easy way to figure out which command causes an error is to put a breakpoint after "fprintf(visaObj,'*RST; :AUTOSCALE');
" and then single step through the code. When you send an incorrect/incompatible command the scope will display an error on it's screen. Go through the scope's programmer manual and find the appropriate command (or parameter range) and modify your version of this code accordingly.
One final note for anyone reading this--in order to pull data off from multiple channels, you need to read each channel sequentially (so call WAVEFORM CHAN1 and read out the data, then WAVEFORMCHAN2, u.s.w.)--there's no routines to pull off multiple channels at the same time.