Using instrument control toolbox to get an instantaneous stream of data from an oscilloscope

3 views (last 30 days)
I am using the invoke command to read a wave from from a Tektronix TDS 2014 oscilloscope. This is the code I am using:
% Create a SERIAL object.
interfaceObj = instrfind('Type', 'serial', 'Port', '/dev/tty.usbserial', 'Tag', '');
% Create the SERIAL object if it does not exist
% otherwise use the object that was found.
if isempty(interfaceObj)
interfaceObj = serial('/dev/tty.usbserial');
else
fclose(interfaceObj);
interfaceObj = interfaceObj(1);
end
% Create a device object.
deviceObj = icdevice('tektronix_tds2014.mdd', interfaceObj);
% Connect device object to hardware.
connect(deviceObj);
% Configure property value(s).
set(deviceObj.Waveform(1), 'FirstPoint', 1.0);
set(deviceObj.Waveform(1), 'EndingPoint', 100.0);
% Execute device object function(s).
groupObj = get(deviceObj, 'Waveform');
groupObj = groupObj(1);
for id = 1:5
[y, x] = invoke(groupObj, 'readwaveform', 'channel1')
ylim([-20 60]);
drawnow;
end
% Disconnect device object from hardware.
disconnect(deviceObj);
% Delete objects.
delete([deviceObj interfaceObj]);
Even though it is in a loop, I need an instantaneous flow of data from the oscilloscope, and not flashes of data points. How can I achieve this?

Answers (1)

Vinod
Vinod on 3 May 2013
Avichal,
By architecture, most, if not all, oscilloscopes works in a certain way:
  1. The digitizer acquires a frame of data when the trigger conditions are met and stores it on the scope's internal memory
  2. The scope's display retrieves this frame of data and displays it on the scope's screen
  3. If there is a request made on the GPIB/SERIAL/TCPIP bus, the scope's firmware will put the data from the last acquisition on the bus
  4. cycle back to step 1
If I understand your question right, what you're looking for is the scope to stream data in, as it is being acquired. I'm not sure that is possible given the current scope architectures. You will want to contact your scope vendor to see if what you want is possible.
Alternatively, you might want to consider a streaming data acquisition device as a means to digitize the signal and bring it into MATLAB. Look up the examples of the Data Acquisition Toolbox to see if this meets your needs.

Categories

Find more on Instrument Connection and Communication in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!