HI there,
I'm interfacing a MSO9254 with matlab 2010b using SCPI commands and I read estrange values for OSC configuration parametres.
I receive DataRaw correct but when reading: +preambleBlock = query(visaObj,':WAVEFORM:PREAMBLE?');+
I gate strange values for Time/div, Volt/div, OrigenX,...
I see on my *OSC Volt/div = 50.0 mV* and in *matlab 0.053957427200000 Volt/div*
Also *OSC Time/div = 10ns* and in *matlab = 1.001000000000000e-08*
It could be that the real values are the ones read by matlab, and the ones shown at the scope are approximations?
If thats correct, is there some where on the scope where I could see real values?
I'm working on High energy Physics so 3mV/div error is important.
Thanks,
Guillermo
I'm interfacing a MSO9254 with matlab 2010b using SCPI commands and I read estrange values for OSC configuration parametres.
I receive DataRaw correct but when reading: +preambleBlock = query(visaObj,':WAVEFORM:PREAMBLE?');+
I gate strange values for Time/div, Volt/div, OrigenX,...
I see on my *OSC Volt/div = 50.0 mV* and in *matlab 0.053957427200000 Volt/div*
Also *OSC Time/div = 10ns* and in *matlab = 1.001000000000000e-08*
It could be that the real values are the ones read by matlab, and the ones shown at the scope are approximations?
If thats correct, is there some where on the scope where I could see real values?
I'm working on High energy Physics so 3mV/div error is important.
Thanks,
Guillermo
I have a MSO9404A and it works correctly. The value it is sending is the same as what's on screen. I don't have MATLAB immediately available, but I may be able to test it later today. If you can send a short section of standalone MATLAB script, I can give it a try. I have used this before and never seen any problems.
You need to verify exactly what the scope is returning because it may just be a problem with the translation going into MATLAB.
You should have the IO Libraries loaded on the same PC as MATLAB. If you don't have it, download it from www.agilent.com/find/iosuite. With that there's an interactive IO capability, so you can send a command like "chan1:scale?", and see the transmitted result.
You can also turn on the debug mode in the scope. Use Utilities -> Remote Setup... then "Debug". You can turn on a mode where all commands, and the results will be displayed on the screen. It's a little ugly, but it works. If the values the scope is sending are correct, but MATLAB is different, then it's a MATLAB problem. Change your script so you read the values into a text array.
Also, be sure that you're looking at the correct values in the preamble. For instance, if you are using 16 bit data (the best), the Volts/div = 2^16 * YIncrement / 8.
Here's some code that I wrote to get and use the preamble block:
preambleBlock = query(inst,':WAVEFORM:PREAMBLE?');
fprintf(inst, '*OPC?'); Junk = str2double(fscanf(inst));
fprintf(inst,':WAV:DATA?');
ScopeData.RawData = binblockread(inst,'int16');
Junk = fread(inst,1,'schar'); % Read the EOF character
maxVal = 2^16;
preambleBlock = regexp(preambleBlock,',','split');
ScopeData.Format = str2double(preambleBlock{1}); % This should be 1, since we're specifying INT16 output
ScopeData.Type = str2double(preambleBlock{2});
ScopeData.Points = str2double(preambleBlock{3});
ScopeData.Count = str2double(preambleBlock{4}); % This is always 1
ScopeData.XIncrement = str2double(preambleBlock{5}); % in Time
ScopeData.XOrigin = str2double(preambleBlock{6}); % in Time
ScopeData.XReference = str2double(preambleBlock{7});
ScopeData.YIncrement = str2double(preambleBlock{8}); % Voltage
ScopeData.YOrigin = str2double(preambleBlock{9});
ScopeData.YReference = str2double(preambleBlock{10});
ScopeData.VoltsPerDiv = (maxVal * ScopeData.YIncrement / 8); % V
ScopeData.Offset = ((maxVal/2 - ScopeData.YReference) * ScopeData.YIncrement + ScopeData.YOrigin); % V
ScopeData.SecPerDiv = ScopeData.Points * ScopeData.XIncrement/10 ; % seconds
ScopeData.Delay = ((ScopeData.Points/2 - ScopeData.XReference) * ScopeData.XIncrement + ScopeData.XOrigin); % seconds
Al