% ReadLeCroyBinaryWaveform - read binary waveform file created by a LeCroy Oscilloscope
% waveform = LeCroyBinaryWaveform(FILENAME) loads the waveform file into the workspace variable W.
% FILENAME can either be a variable or a string constant enclosed by quotes.
% The return value "waveform" is a record containing four elements:
% waveform.INFO Waveform information, in readable formats. For example Oscilloscope ID, sampling time and settings
% waveform.DESC Waveform information used for further calculations. For example Sampling rate
% waveform.Y Values sampled by the oscilloscope
% waveform.X Array of time values corresponding to waveform.Y. Time '0' marks the trigger event
UPDATE: MATLAB now supports direct instrument control and configuration of these oscilloscopes when using MATLAB with the Instrument Control Toolbox. This includes the ability to acquire waveform data directly into MATLAB for analysis.
A MATLAB instrument driver for most of these oscilloscopes can be downloaded at:
A Getting Started Guide for using MATLAB with these oscilloscopes can be downloaded at:
Very good, but I think I found some bugs:
If you load 16bit data you get twice as much x values then you get y values. I added a variable recordcount which is = AVE_ARRAY_1 when reading byte-data and =WAVE_ARRAY_1/2 when reading word-data. And I think that it has to be ...[0:recordcount-1]...
02 May 2007
Thank you very much!
11 May 2006
Used this code to write VBA version to load Lecroy_2_3 files directly into Excel. Saves faffing with ascii function on the scope. Very helpful.
12 Apr 2006
A very fine piece of software, minor changes are necessary to get it to work with octave (remove some "newlines" in arrays). I am using it with LeCroy 9350, LECROY_2_2 files and Lecroy WR LT372, LECROY_2_3 files.
Great program. Works for the waveform files generated by LeCroy WR6100 LECROY_2_3.
One question though, the time value is shifted toward positive direction by 1 sampling time, when compared to the values in the text file converted by LeCroy ScopeExplorer. Don't know which one is correct.
28 Feb 2006
Just what I was needing !;o)
Works fine with my LeCroy 9350, LECROY_2_2 files.
02 Feb 2006
Works out of the box for LECROY_2_3 files. Thank you! Note: The returned structure W contains not only the oscilloscope trace, but also the sampling rate, sampling frequency, and other information about the data acquisition (trigger time, channel, nominal bits, etc.)