Skip to content

Commit

Permalink
add control info to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lobis committed Nov 8, 2022
1 parent 194bc1b commit 9af3fe3
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
This is an unofficial Python package to interface with Teledyne LeCroy oscilloscopes and read binary trace
files (`*.trc`).

Currently only reading trace files is supported.

This package is based on
The parsing of `trc` files is based on
the [lecroy-reader](https://github.com/neago/lecroy-reader/blob/49c42a85c449013c1c48d154ae70192f172e32ba)
project.

Expand Down Expand Up @@ -42,7 +40,7 @@ pip install .[test]

## 👨‍💻 Usage

### Reading binary trace files (`*.trc`)
### 📖 Reading binary trace files (`*.trc`)

```python
from lecroyscope import Trace
Expand Down Expand Up @@ -75,3 +73,33 @@ time = trace.time # trace.x is an alias for trace.time
# channel voltage values
voltage = trace.voltage # trace.y is an alias for trace.voltage
```

### 📟 Acquisition with LeCroy oscilloscope

```python
import lecroyscope

scope = lecroyscope.Scope("192.168.1.10") # IP address of the scope

# print some info
print(f"Scope ID: {scope.id}")

# change to "Sequence" mode with 200 segments
scope.sample_mode = "Sequence"
scope.num_segments = 200
print(f"Sample mode: '{scope.sample_mode}' with {scope.num_segments} segments")

# acquire data with a single trigger, timout (fail) after 60 seconds
scope.acquire(timeout=60)

# Read channel 2 and 3 traces
# The data in the scope won't change until next acquisition
trace_channel2: lecroyscope.Trace = scope.read(2)
trace_channel3: lecroyscope.Trace = scope.read(3)

# Alternatively, it is recommended to use the TraceGroup class for reading multiple channels from the same trigger
trace_group: lecroyscope.TraceGroup = scope.read(2, 3)
trace_channel2 = trace_group[2]
trace_channel3 = trace_group[3]
time = trace_group.time # time values are the same for all traces
```

0 comments on commit 9af3fe3

Please sign in to comment.