Collect over 10,000 data points from a Tektronix oscilloscope?

I am creating a MATLAB GUI to collect data from a Tektronix DPO4104 oscilloscope (the MATLAB driver is here ).

I play with tmtool and with my GUI, and found that the driver can only collect 10,000 data points, regardless of whether an oscilloscope is installed to display more than 10 thousand points. I found this post in CCSM , but it was not very helpful. (I am the last post there if you want to read it.) I am using the DPO4104 driver, while this post discusses the use of the DPO4100 driver, I believe.

As far as I can tell, the steps are:

  • Change the readwaveform driver to account for the current recordLength - in my case, 100,000 points, say.
  • Manually edit the MaxNumberPoint driver from 10,000 to 100,000. (In my case, the default number was 0 .. I changed this to 100,000).
  • Manually edit EndingPoint . I also set this to 100,000.
  • Before creating the device object set(interfaceObj, 'InputBufferLength', 2.5*recordLength) , that is, make sure that the input buffer contains more than 100,000 points. He recommended using at least the double expected buffer. I used 2.5 just because.
  • Create an object object and a waveform object, connect() to it and readwaveform . Profit.

I still cannot collect more than 10,000 points, either through tmtool , or through my GUI. Any help would be appreciated.

+8
matlab oscilloscope
source share
4 answers

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.

+1
source share

I have a Tektronix engineer; he basically told me to just use SCPI commands directly and skip the driver. Although annoying, this may be the easiest solution.

+2
source share

Is it possible that you collect data at 10,000 at a time, then save it somewhere, collect the next 10,000, add it to the saved points, repeat it?

This is a workaround, of course.

+1
source share

Here is a bad idea. Start collecting 10,000 points. When you get to 5000 points, start collecting data again (you may need to run this in a new thread). Continue back and forth until all necessary data is stored in some 20 data structures. Then combine the structures into one structure by building data points. This may be more than calling SCPI commands directly and possibly some unpleasant caveats that I did not think about. But, as I said, this is a bad idea ...

0
source share

All Articles