I have a Tektronix DPO4000 series oscilloscope connected to my PC via USB. I'm using the Instrument Control Toolbox and have followed the guide 'USING MATLAB WITH A DPO4000 AND MSO4000 SERIES OSCILLOSCOPES' provided by Tektronix. All works as expected and I am able to save waveform data from each channel on the scope using the 'readwaveform' function.
For my application I need to save 100,000 data points, I have set the record length on the scope to 100,000 yet when I read the data in to MATLAB via USB I only get the first 10,000 points. When I save the data directly on the scope I get the full 100,000 points so I know that's OK. After a little digging I thought that perhaps the input buffer is too small, consequently I have changed it's size to 250,000, yet I still only get 10,000 points! Any ideas??
Thanks,
Jim.
Answering Jim her as well...
It appears that the MSO4000 series drivers do not take into account the
record length so it will need to be modified with MIDEDIT. I don't have
this instrument handy for testing but the code for the readwaveform method
would need additional code added like the following:
...
try
% Specify source
fprintf(interface,['DATA:SOURCE ' trueSource]);
%%%%% START CODE TO HANDLE > 10,000 points %%%%%%%%%%
recordLength = query(obj, 'HORIZONTAL:RECORDLENGTH?');
fwrite(' DATA :START 1');
fwrite([' DATA :STOP ' num2str(recordLength)]);
%%%%%%%% END CODE TO HANDLE > 10,000 points %%%%%%%%%
% Issue the curve transfer command.
fprintf(interface, 'CURVE?');
raw = binblockread(interface, 'int16');
% Tektronix scopes send and extra terminator after the binblock.
fread(interface, 1);
catch
set(obj, 'Precision', oldPrecision);
set(obj, 'ByteOrder', oldByteOrder);
error(lasterr);
end
...
All the best,
I am having the same problem as you. Did you manage fix it ?
regards
Mario
Hi Mario,
I've fixed the problem now.
I added the code that Trent kindly provided, however, I was still only able to record 10,000 data points. I spent some time looking through the various functions and properties and found a property called 'MaxNumberPoint' it was set to 10,000. I tried to increase this to 100,000 but wasn't able to. I edited the driver file and set this property manually. Now the system works fine, I get 100,000 data points as desired (BTW be sure to increase the buffer length to accomodate).
Regards,
James.