No BSD License  

Highlights from
Lecroy 94xx Oscilloscope Waveform Download

from Lecroy 94xx Oscilloscope Waveform Download by Patrick Edson
Download parameters and waveforms from a Lecroy oscilloscope using the Instrument Control Tbx

LCWaveform(obj, channel)
function waveform = LCWaveform(obj, channel)
%  LCWAVEFORM Download and scale a waveform.
%
%     LCWaveform is a sample function that pulls LCGetWaveDescBlock and LCGetWaveForm
%     to dowbload both the waveform and the waveform description, and return a 
%     structure with not just the raw data, but the scaled time and voltage values.
%
%     W = LCWaveform(OBJ, CHANNEL) uses instrument object OBJ to return a structure
%     W containing the total waveform description structure, raw data, scaled voltage
%     and scaled time values for the waveform on channel CHANNEL.

if nargin < 1
    channel = 'C1';
end

fprintf(obj, 'CFMT DEF9,BYTE,BIN');

fprintf(obj, 'CORD LO');

wd = LCGetWaveDescBlock(obj, channel);

WAVE = LCGetWaveForm(obj, channel);

time = ((0:(wd.WAVE_ARRAY_COUNT - 1)) .* wd.HORIZ_INTERVAL + wd.HORIZ_OFFSET)';

volt = WAVE .* wd.VERTICAL_GAIN + wd.VERTICAL_OFFSET;

waveform.waveDesc = wd;
waveform.rawData = WAVE;
waveform.volts = volt;
waveform.time = time;


Contact us at files@mathworks.com