File Exchange

image thumbnail

ReadLeCroyBinaryWav​eform.m

version 1.0 (11.8 KB) by

Reads LeCroy binary waveforms.

7 Downloads

Updated

No License

% 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

Comments and Ratings (19)

@joedeane

Works really well! (LeCroy Waverunner LT246M)

Minh Le

Vit

Vit (view profile)

Awesome - works right away no hassle - many thanks (Lecroy 610 Zi)

Vit

Vit (view profile)

Keith Bonin

Great program! Well-documented and easy to use.

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:
http://www.mathworks.com/matlabcentral/fileexchange/12862

A Getting Started Guide for using MATLAB with these oscilloscopes can be downloaded at:
http://www.mathworks.com/products/instrument/supportedio13762.html

Lennaert

Excellent, worked straight away! Thanks a lot.

Nikias Klohr

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]...

Greetings,
Nikias Klohr

Evgueni Sliva

Very helpful!
Thank you very much!

Simon Jenkins

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.

Holger Doerr

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.

Xiaotian Sun

Read the source. I think the line

wave.x = [1:WAVE_ARRAY_1]'*HORIZ_INTERVAL + HORIZ_OFFSET;

shoud be changed to

wave.x = [0:(WAVE_ARRAY_1-1)]'*HORIZ_INTERVAL + HORIZ_OFFSET;

Xiaotian Sun

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.

Morten Lunow

Just what I was needing !;o)
Works fine with my LeCroy 9350, LECROY_2_2 files.

Ronald Kumon

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.)

Scott Hanchar

Great Program

Stefan Müller

Excellent work. Thank you

Christian Franck

Lev Greenberg

Very Good

MATLAB Release
MATLAB 7.4 (R2007a)
Acknowledgements

Inspired: ReadLeCroyBinaryWaveform.m

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video