LeCroyTRC.jl

LeCroyTRC — Module
LeCroyTRC

Read LeCroy oscilloscope waveform files (.trc, template LECROY_2_3): the binary format the scopes write when a trace is saved to disk, and the reply to WF? ALL.

w = readtrc("C1--capture--00000.trc")
plot(times(w), volts(w))

readtrc reads a whole record, trcinfo only its descriptor. The samples stay as the scope stored them (Int8 or Int16 codes); volts scales them and times gives the horizontal axis. Sequence captures split with segments.

The layout follows LeCroy's own template (Remote Control Manual, Appendix II, "Waveform Template"): every descriptor field, both byte orders, byte and word samples, the user text, the TRIGTIME (sequence) and RIS_TIME arrays, the reserved blocks, and the second data array of extrema, complex and peak-detect records. A file that declares something it does not contain is refused with a LeCroyTRC.FormatError, never misread.

source

Installing

using Pkg
Pkg.add(url = "https://github.com/Thenewmanator15/LeCroyTRC.jl")

A first read

using LeCroyTRC

w = readtrc("C1--capture--00000.trc")
t = times(w)        # seconds from the trigger: HORIZ_OFFSET + i * HORIZ_INTERVAL
v = volts(w)        # VERTICAL_GAIN * code - VERTICAL_OFFSET
w.data1             # the samples as stored: Vector{Int16} (or Int8)
w.info.trigger_time # every descriptor field, by its template name

Every function and type is described in the Reference.

What the reader covers and how it is checked is in the README.