Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Problem reading data from Tektronix oscilloscope

Subject: Problem reading data from Tektronix oscilloscope

From: james

Date: 8 Dec, 2009 20:14:02

Message: 1 of 6

Dear all,

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.

Subject: Problem reading data from Tektronix oscilloscope

From: Trent Jarvi

Date: 8 Dec, 2009 23:35:04

Message: 2 of 6


"james " <jimwalsh142@hotmail.com> wrote in message
news:hfmc2a$acg$1@fred.mathworks.com...
> Dear all,
>
> 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,
>

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,

Subject: Problem reading data from Tektronix oscilloscope

From: mario Farrugia

Date: 29 Jan, 2010 16:31:22

Message: 3 of 6

"Trent Jarvi" <tjarvi@mathworks.com> wrote in message <hfmnr8$5fs$1@fred.mathworks.com>...
>
> "james " <jimwalsh142@hotmail.com> wrote in message
> news:hfmc2a$acg$1@fred.mathworks.com...
> > Dear all,
> >
> > 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,
> >
>
> 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,
>
>
>
>
>
Hi James,

I am having the same problem as you. Did you manage fix it ?

regards
Mario

Subject: Problem reading data from Tektronix oscilloscope

From: james

Date: 1 Feb, 2010 09:53:02

Message: 4 of 6

"mario Farrugia" <eexmf3@nottingham.ac.uk> wrote in message <hjv2gq$f9c$1@fred.mathworks.com>...
> "Trent Jarvi" <tjarvi@mathworks.com> wrote in message <hfmnr8$5fs$1@fred.mathworks.com>...
> >
> > "james " <jimwalsh142@hotmail.com> wrote in message
> > news:hfmc2a$acg$1@fred.mathworks.com...
> > > Dear all,
> > >
> > > 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,
> > >
> >
> > 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,
> >
> >
> >
> >
> >
> Hi James,
>
> 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.

Subject: Problem reading data from Tektronix oscilloscope

From: Bo

Date: 6 Nov, 2012 21:52:08

Message: 5 of 6

I met this problem too. Now I have solved this problem. Actually there are 2 properties we need to modify. The first one is 'Endingpoint', which belongs to waveform properties. The default number is 10000, we could set that to be the same as Recordlength by editing the driver file *.mdd. The other one is input buffer size. That one could be configured by the set command. It should be at least 2 times larger than the recordlength. After that I am able to get a waveform which contains 10M points.


"mario Farrugia" wrote in message <hjv2gq$f9c$1@fred.mathworks.com>...
> "Trent Jarvi" <tjarvi@mathworks.com> wrote in message <hfmnr8$5fs$1@fred.mathworks.com>...
> >
> > "james " <jimwalsh142@hotmail.com> wrote in message
> > news:hfmc2a$acg$1@fred.mathworks.com...
> > > Dear all,
> > >
> > > 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,
> > >
> >
> > 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,
> >
> >
> >
> >
> >
> Hi James,
>
> I am having the same problem as you. Did you manage fix it ?
>
> regards
> Mario

Subject: Problem reading data from Tektronix oscilloscope

From: Clayton Chu

Date: 14 Dec, 2012 01:54:09

Message: 6 of 6

"Bo" wrote in message <k7c0q8$d5n$1@newscl01ah.mathworks.com>...
> I met this problem too. Now I have solved this problem. Actually there are 2 properties we need to modify. The first one is 'Endingpoint', which belongs to waveform properties. The default number is 10000, we could set that to be the same as Recordlength by editing the driver file *.mdd. The other one is input buffer size. That one could be configured by the set command. It should be at least 2 times larger than the recordlength. After that I am able to get a waveform which contains 10M points.

I'm having trouble getting more than 10k points out too. I'm using the DPO4014 driver, though.

My EndingPoint default number was actually 0 in my driver file. I changed it to 100000 manually. Then I set the InputBufferSize in MATLAB to 210000. ANy ideas?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us