I get it! I think. Taking a couple of weeks to back off and refresh really helped. Here is what I did:
1) Edit the init driver function to configure a larger buffer size. Full init code:
function init(obj) % This method is called after the object is created. % OBJ is the device object. % End of function definition - DO NOT EDIT % Extract the interface object. interface = get(obj, 'Interface'); fclose(interface); % Configure the buffer size to allow for waveform transfer. set(interface, 'InputBufferSize', 12e6); set(interface, 'OutputBufferSize', 12e6); % Originally is set to 50,000
I initially tried to set the buffer size to 22e6 (I wanted to get 10 million points), but I got errors from memory. Presumably, the buffer should be a little more than twice as large as you expect, plus heading space. I probably don't need the 2 million headline glasses, but yes.
2) Edit the readwaveform() driver to first request what the user must define for scoring. Then write the SCPI commands to the area to ensure that the number of data points transmitted is equal to the number of points that the user wants. The following snippet will do the trick in readwaveform :
try % Specify source fprintf(interface,['DATA:SOURCE ' trueSource]); %----------BEGIN CODE TO HANDLE MORE THAN 10k POINTS---------- recordLength = query(interface, 'HORizontal:RECordlength?'); fprintf(interface, 'DATA:START 1'); fprintf(interface, 'DATA:STOP %d', str2num(recordLength)); %----------END CODE TO HANDLE MORE THAN 10k 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);
3) In the user code, set the SCPI command to resize the record to the base interface object:
% interfaceObj is a VISA object. fprintf(interfaceObj, 'HORizontal:RECordlength 5000000');
There you have it. Hope this helps someone else trying to figure this out.
Dang khoa
source share