Main Content

readWaveform

Returns waveform displayed on scope

Syntax

w = readWaveform(myScope);
w = readWaveform(myScope, 'acquisition', true);
w = readWaveform(myScope, 'acquisition', false);

Description

w = readWaveform(myScope); returns waveform(s) displayed on the scope screen. Retrieves the waveform(s) from enabled channel(s). By default it downloads the captured waveform from the scope without acquisition.

w = readWaveform(myScope, 'acquisition', true); initiates an acquisition and returns waveform(s) from the oscilloscope.

w = readWaveform(myScope, 'acquisition', false); gets waveform from the enabled channel without acquisition

This function can only be used with the oscilloscope object. You can use the getWaveform function to download the current waveform from the scope or to initiate the waveform and capture it. See the examples below for the three possible use cases.

Note

This is the getWaveform function. In R2017a the name changed from getWaveform to readWaveform. The getWaveform function will continue to be supported.

Examples

Use this example if you have captured the waveform(s) using the oscilloscope's front panel and want to download it to the Instrument Control Toolbox™ for further analysis.

 o = oscilloscope()
 set (o, 'Resource', 'instrumentResourceString');
 connect(o);
 w = getWaveform(o);    

Replace 'instrumentResourceString' with the resource string for your instrument.

Use this example to get the waveform from a circuit output (without configuring the trigger) and download it to the Instrument Control Toolbox to check it.

 o = oscilloscope()
 set (o, 'Resource', 'instrumentResourceString');
 connect(o);
 enableChannel(o,'Channel1');
 w = getWaveform(o);

Replace 'instrumentResourceString' with the resource string for your instrument.

Use this example to capture synchronized input/output signals of a filter circuit when a certain trigger condition is met, stop the acquisition, and download the waveforms to the Instrument Control Toolbox.

 o = oscilloscope()
 set (o, 'Resource', 'instrumentResourceString');
 connect(o);
 set (o, 'TriggerMode','normal');
 enableChannel(o, {'Channel1','Channel2'});
 [w1, w2] = readWaveform(o, 'acquisition', true);

Replace 'instrumentResourceString' with the resource string for your instrument.

Version History

Introduced in R2011b