Open Lab Automation is an open-source suite for automated electrical measurements, designed for hobbyists, makers, and lab enthusiasts. A PyQt6 graphical interface configures the instruments and the project files; the instruments are driven through logical calls (set_voltage, read_scan, ...) that the instrument library (Instruments_LIB) translates into the commands of each model, so the software does not depend on the brand of the instrument. Instruments are reached over LAN, USB-TMC, GPIB or serial (RS-232) through VISA.
Important
This software is under active development. Features and stability may change, and some parts may be incomplete or experimental. Most instrument models in the library are marked experimental: they are written from the manuals and have not been tried on a real instrument (see Supported instruments).
- Main Features
- Project Structure
- Requirements
- Getting Started
- Engine (
ola/andnative/) - File List and Description
- Troubleshooting
- Software test status
- Future features
- Disclaimer
- Contributing
- License
- Support
-
Instrument library and logical calls
- The JSON library (
Instruments_LIB/instruments_lib.json) describes every model: interfaces, channels, limits and how each logical call is implemented. The call names and their arguments are fixed per category by the schemas inInstruments_LIB/schema/. - Three-level selection: type → series → model, with dynamic options; experimental models are shown only when enabled in Settings.
- Serial instruments get their settings (baud rate, parity, stop bits, flow control, terminators) from the library, overridable per instrument.
- Guided VISA address composition for each interface (LXI, USB-TMC, GPIB, serial). A serial port can be given as a number, as
COM3or as a device (/dev/ttyUSB0).
- The JSON library (
-
Remote control panel
- Power supplies, electronic loads, oscilloscopes and dataloggers are controlled with the same logical calls, whatever the brand.
- Dataloggers are configured from the
.instfile: function of each channel and scan list. Channels are given bychannel_id(e.g.101) or asCH1..CHnwith the slot number; temperature channels use the probe and sensor types of the library (e.g. thermocouple type K). - Oscilloscope settings from a
.wasfile: enabled channels are switched on (the others off), probe attenuation is set before the vertical scale, then timebase and trigger (source, slope, level, mode).
-
Manual instruments
- A bench supply or load without remote control can be added to a project (Add manual instrument in the instrument editor: type, name, maximum voltage and current). A manual instrument is one channel (a supply with two outputs is two manual instruments) and is not part of the library.
- When a value must be set, the software asks the operator with a pop-up ("set X to 10 V, then press OK"); Cancel stops the measurement. Manual instruments are not read: readings come from other instruments.
-
Measurements (each one a module of
ola/modules/, with a guide indocs/and a simulated bench for the tests; details in the table of the engine section)- Power: efficiency sweep, line and load regulation, ripple and noise.
- RF with a VNA: S-parameters, return loss, filter, amplifier, attenuator, antenna, cable (with de-embedding of cables and pads), time domain (TDR) for the position of a fault along a cable, components (inductors, capacitors, resistors: impedance, ESR, Q, self-resonance), quartz crystals (equivalent circuit, frequency with a load, pulling).
- Frequency response with a generator and a scope: Bode plot with bandwidth, phase and gain margin.
- Time log of any variable.
- Cable and device registry with labels, wiring diagrams before each run, CSV results (Touchstone for RF).
-
Project management
- Measurement projects with their configuration files:
.json(project and variables),.inst(instruments),.was(oscilloscope settings) and one file per measurement (.eff,.cbl,.flt, ...; see Project Structure). - Dedicated editors for instruments, efficiency sweeps and oscilloscope settings, with advanced naming options for files and instances.
- Measurements are run from the Measurements tab (the project window): new measurement, edit, Start measurement and the runs already made; see the Engine section for the measurement types. They have been tried only with simulated instruments so far.
- Measurement projects with their configuration files:
-
Tools (Tools menu)
- Hex/Dec/Bin converter.
- Instrument library manager: browse the library and add instruments to it.
-
Testing instruments from the terminal (no GUI needed): an interactive instrument shell and a dry run that shows the exact commands a logical call would send; see Trying an instrument from the terminal.
-
Error handling & validation
- Standardized error codes with resource prefixes (
[RESOURCE-XXX], e.g.CALL-xxxfor the instrument calls, shown to the user and logged with the stack trace; seeERROR_CODES.md. - Validation of user inputs; fully translatable interface (Italian, English, French, Spanish, German).
- Standardized error codes with resource prefixes (
- Frontend: Python (PyQt6) — Modern graphical interface with comprehensive instrument management and advanced sweep configuration
- Engine (
ola/,native/): Python + Rust — Qt-free instrument transport, step executor and measurement core (see Engine below) - Instrument Library: JSON (
Instruments_LIB/instruments_lib.json) — Extensible database of supported instruments - Configuration Files:
<project>.json— Project metadata ("format_version": 2), the list of its measurements and the variable definitions.inst— Instrument configuration and channel setup.was— Oscilloscope waveform acquisition and trigger settings- One file per measurement, the extension gives its type (each type is a module of
ola/modules/, see Engine):.amp— RF amplifier.ant— Antenna impedance.att— Attenuator.bod— Bode plot.cmp— Component impedance (L, C, R).cbl— Cable characterization.eff— Efficiency sweep, with nested variable support.flt— Filter.reg— Line and load regulation.rfe— Efficiency with a resistive load.pls— Current pulse on an electronic load.rtl— Return loss / VSWR.rpl— Ripple and noise.spm— S-parameters (VNA).tdr— Time domain (TDR).xtl— Quartz crystal.tlg— Time log
runs/— Results of each run, in the project folder (JSON Lines)
- Python 3.10+
- PyQt6
- Git (the instrument library
Instruments_LIBis a submodule) - Additional Python packages listed in
requirements.txt
-
Clone the repository:
git clone --recurse-submodules https://github.com/mede-erik/Open-Lab-Automation.git cd Open-Lab-AutomationIf you already cloned without
--recurse-submodules, download the instrument library with:git submodule update --init
-
Install Python dependencies:
pip install -r requirements.txt
-
Launch the application:
python frontend/launcher.py
The instrument shell connects to one instrument of the library and runs its logical calls, showing exactly which commands are sent and what comes back. It is the quickest way to check a library entry against a real instrument (see Instruments_LIB/TESTING.md).
python scripts/instrument_shell.py # choose category, model and interface, then connect
python scripts/instrument_shell.py --sim # no hardware: a simulated instrument answersOnce connected, help lists the commands. The main ones:
| Command | What it does |
|---|---|
calls / missing |
list the calls the model defines / the mandatory calls it lacks |
call NAME a=v ... |
run a call (missing arguments are asked) |
plan NAME a=v ... |
show the commands without sending them |
readback NAME |
read back the value of a set call |
test [writes] [all] |
run every call that needs no argument (writes also runs the actions) |
was FILE.was [plan] |
apply the settings of an oscilloscope .was file |
fullwave CH, save FILE.csv, stats |
read the whole memory of a channel, save the last waveform, show its statistics |
serial, probe, loopback, raw TEXT |
RS-232 settings, find the settings an instrument answers to, adapter test, send a raw string |
The arrow keys recall previous commands (kept between sessions) and Tab completes them; on Windows this needs pyreadline3 (in requirements.txt).
To see the commands a call would send to a model, without any instrument:
python scripts/dry_run_call.py --model OSC_Siglent_SDS824X_HD --call set_channel_scale --arg channel_number=1 --arg value=0.5
python scripts/dry_run_call.py --model OSC_Rigol_DS1054Z --was project.waspytest # all tests (tests/ and the test_*.py files at the root)
python scripts/check_translations.py # language filesThe library currently describes:
| Category | Series |
|---|---|
| Power supplies | OWON ODP, Keysight E36300, TDK-Lambda GEN, Rohde & Schwarz HMP, HP E3631A |
| Electronic loads | Chroma 6330A, Keysight EL4900, Siglent SDL1000X-E |
| Oscilloscopes | Tektronix 5 Series MSO, Rigol DS1000Z, Siglent SDS HD, GW Instek GDS-1000B, Digilent Analog Discovery 2 (driver) |
| Dataloggers | Agilent 34970A, Keysight 34972A, Keysight DAQ970A/DAQ973A |
| Switch units | Agilent 3499A |
| Function generators | Rigol DG1022 / DG1022A, Agilent 33120A, Digilent Analog Discovery 2 (driver) |
| Multimeters | HP 3478A, Agilent 34401A (experimental, never tried on a real instrument) |
| Network analyzers | Zenko LiteVNA (driver), Siglent SNA, Rohde & Schwarz ZNB/ZNL/ZNLE, ZVA/ZVB/ZVT/ZVL (all experimental, never tried on a real instrument) |
Tried on a real instrument so far: Agilent 34970A over RS-232 and Siglent SDS824X HD over LAN (readings, settings, 8/16-bit waveforms and whole-memory transfers, .was files). All the other models are written from the manuals; many are marked experimental in the library. The Analog Discovery 2 needs the Digilent WaveForms runtime. Reports of tests on other instruments are welcome: Instruments_LIB/TESTING.md explains how to test and what to report.
- Create a new project or open an existing one
- Add instruments using the three-level selection (Type → Series → Model), or add a manual instrument for a bench supply or load without remote control
- Configure instruments:
- For dataloggers with slots: use the "Configure Datalogger Slots" button to select modules
- For other instruments: configure channels, variables, and measurement settings
- Set up efficiency sweeps with nested variables in the
.efffile editor - Configure oscilloscope acquisition and trigger in the
.wasfile editor - Start the measurements from the Measurements tab and follow them in the run window; the remote control panel drives single instruments by hand
Check the examples/ directory for sample configurations:
test-dcdc-project/— DC-DC converter efficiency measurement setupTest_scpi/— Basic SCPI communication examples
The engine is everything that talks to instruments and runs measurements. It has no Qt dependency, so it can be used from the GUI, from scripts and from tests (import frontend.core needs PyQt6, import ola does not). The Measurements tab of the GUI runs the measurements through it, and the remote control panel uses its logical calls.
measurement module (Python) what to measure: setup / run / teardown
| handle.call("set_voltage", value=5) logical calls, no SCPI
v
instrument layer ola/instrument.py steps write / query / read / delay,
| one lock per instrument per call
v
transport ola/transport.py TCP raw socket, serial (Rust)
ola/_visa.py USB-TMC, GPIB, VXI-11 (pyvisa)
ola/prologix.py GPIB via Prologix-compatible adapters
| Path | Purpose |
|---|---|
native/ |
Rust crate ola_native (PyO3): TCP (TCP_NODELAY, deadline-bounded buffered reads), serial, IEEE 488.2 blocks. The GIL is released during I/O. |
ola/transport.py, ola/_pyconn.py |
Entry point; uses ola_native if installed, otherwise a pure-Python implementation with identical behaviour (OLA_TRANSPORT=python forces it). |
ola/_visa.py |
pyvisa adapter with the same interface. It never leaves a shared pyvisa resource modified. |
ola/gpib_adapter.py, ola/prologix.py, ola/gpib_linux.py, frontend/ui/GpibAdapterDialog.py |
GPIB adapters (Tools > GPIB adapters): profiles of the supported adapters (Keysight 82357B / 82357A, NI GPIB-USB-HS, Measurement Computing USB-488, any VISA GPIBn board, Prologix GPIB-USB / GPIB-ETHERNET, AR488), their configuration, the driver check, the bus scan, IFC / REN and a console. ola/prologix.py is the transport for the Prologix-compatible adapters (address PROLOGIX::<port>::<gpib address>::INSTR; several instruments share one link). ola/gpib_linux.py checks and does the Linux set-up of an adapter driven by linux-gpib (a new Keysight 82357B: linux-gpib, firmware and fxload, udev, /etc/gpib.conf, gpib group), as administrator through pkexec. Guide: docs/gpib-adapters.md. |
ola/steps.py, ola/instrument.py |
A call is a list of steps (write, query, read, delay) run in order; the first failure stops it (CALL-004 with the step index). driver plans (e.g. Analog Discovery via its SDK) are dispatched to a driver object. |
ola/measurement.py, ola/runner.py |
Measurement base class and the thread runner: setup, run, and always teardown; stop, pause/resume, errors with code and traceback. |
ola/registry.py, ola/modules/ |
Measurement modules, found from their module.json. Finding a module never runs its code; a module that is not built in needs explicit permission to load. |
ola/project.py, ola/runs.py |
Project with several measurements, one file per measurement (the extension identifies the type); run results written while the measurement runs (JSON Lines); a run that fails is deleted when it ends (RunWriter(discard_failed=True), the default of the project; Settings > Keep the measurements that failed keeps them) and delete_run deletes a run and its waveform folder on purpose (Delete... in the history of a cable or a device and in the list of the runs of a project). The project has a stable project_id; a run file is named <measurement>_<date>_<time>_<run id>.jsonl and its header says who made it (author, host, software_version). |
ola/fileio.py, ola/provenance.py |
atomic_write_text / atomic_write_json: files of the project, the instruments and the registry are written to a temporary file and renamed, so a crash or a second program never sees half a file. provenance() gives the author ($OLA_AUTHOR, else the system user), host and software_version kept in every run header. Preparation for the shared archive: docs/proposals/shared-archive.md. |
ola/sim.py |
Simulated transport for development and dry runs without hardware. |
ola/library.py, ola/call_planner.py, ola/parsers.py, ola/instrument_handle.py |
The instrument library and the translation of a logical call into what an instrument understands: Library loads instruments_lib.json and the call schemas; the planner turns a call, its arguments and a model into a validated plan of steps; parsers turn several raw answers into one logical value; InstrumentHandle is what a measurement uses (handle.call("set_voltage", value=5)). Guide: docs/instrument-calls.md. |
ola/manual_instrument.py |
Manual instruments (a bench supply or load without remote control): the handle asks the operator, through a prompt, to do each action by hand, and checks the values against the instrument's limits. |
ola/channel_setup.py, ola/sim_datalogger.py, frontend/ui/channel_settings.py |
Per-channel datalogger settings (range, integration time, offset zero with shorted inputs, input impedance): the calls, the wrapped handle the measurements read through, the zero procedure and its editor cells; the simulated 34970A used by the tests. See docs/datalogger-channels.md. |
ola/scope_capture.py, ola/wave_align.py, ola/wave_view.py |
Waveforms during the efficiency measurements (no Qt): scope_capture in the file (instruments, every and/or when, optional max, channels, bits, wait_s). At a step that is due (every N, or a quantity beyond a limit, up to max), after the readings, the oscilloscopes of the role scope take one capture for each scope settings file of the project that is switched on, one after another in the order of the list; a file can be for one oscilloscope only. Every oscilloscope is set and armed, the trigger is waited for (forced, and marked, if it does not arrive) and the whole memory of every channel is read; each capture is a binary file (ola/wavefiles.py) and the run file gets a row of the table waves that says why it was taken. A failure of an oscilloscope is a warning and the run goes on. estimate gives the size before the start (above about 1 GB the window asks). wave_align aligns two oscilloscopes after the run through a channel with the same name on both (cross-correlation refined to a fraction of a sample, a poor match refused), writes alignment.json and exports both on one time axis. wave_view (no Qt) is the logic of the viewer: the index of the captures of a run read from the headers only, a small cache, the min/max decimation that keeps a long record drawable, the shifts of the alignment. The viewer is the Waveforms tab of the run window (it fills while the run goes) and the Waveforms... button of the runs list of the project (frontend/ui/WaveformView.py, frontend/ui/WavePlot.py): steps and channels to choose, wheel zoom, drag, two cursors with dt and dV, the results of the step under the plot, CSV export. Guides: docs/efficiency.md, docs/waveform-files.md. |
ola/wavefiles.py |
The waveforms of a run as binary files (no Qt): one .npz per capture (the channels of one oscilloscope acquired together at one step, one acquisition), in a folder next to the run file (<run>_waves/); float32 samples, the time only if the sampling is irregular, a JSON meta. The run file keeps only an index (index_entry), the folder can be deleted without touching the results (missing_files, delete_waves), and estimate_bytes gives the size before a run. Guide: docs/waveform-files.md. |
ola/legacy_project.py |
Old projects (no Qt): the efficiency files listed in eff_files of a project of the first format become measurements of the project. Sweeps and the two delays are carried over (the first sweep of the old file was the outer one, so the order is reversed; the delays become settle_s and cooldown_s); the old files did not say which instrument call sets a quantity, so each variable has its sweep and no set, and the report says that the call must be chosen in the editor. Each old file is copied to <name>.bkp before it is replaced; a missing or foreign file is reported and left alone. Called by Project.upgrade_legacy. |
ola/was_editor.py |
The editor of the .was files (no Qt): WasEditor keeps the content, reads it (a broken file starts empty), gives the values of the form and takes them back (reset written only when false, only the enabled channels), reads and writes the JSON text and saves atomically; parse_time (1ms, 100us, 0,5), parse_level, oscilloscopes and channels_of read the .inst file. The window (frontend/ui/WasFileDialog.py) only draws the form. |
ola/datalogger_setup.py, ola/multimeter_setup.py, ola/was_calls.py (also check_was and the reset key), ola/waveform.py, ola/pulse_power.py |
From project files and instruments to logical calls: the datalogger channels of an .inst file, the function and range of the channel of a multimeter (one input: the first enabled channel), the oscilloscope settings of a .was file, the transfer of a whole waveform memory, and the power of a current pulse on an electronic load. |
ola/serial_config.py, ola/tester.py |
Serial (RS-232) settings applied to a VISA resource, and the helpers of the interactive instrument tester (scripts/instrument_shell.py): choose a model, connect, run logical calls, self-test a library entry. |
ola/form_model.py, frontend/ui/FormEditorDialog.py |
An editor window for a measurement file with no code of its own: a module puts a form.json (sections and fields: text, number with SI prefixes, choice, tick boxes of several choices, list, JSON, instrument; some shown only for some values of another field) next to its module.json. Every problem the module reports (check()) is shown at its field; a required instrument that is not chosen is an error. Strings in five languages. Guide: docs/measurement-modules.md. |
ola/modules/sparameters/ |
S-parameters (.spm), a built-in measurement module: one sweep of a network analyzer and its S-parameters as complex curves. It uses only the logical calls set_frequency_sweep, run_sweep and read_sparameters of the library; role vna of category network_analyzer. Edited in its own window (form.json: sweep, the S-parameters as tick boxes, repetitions, calibration and golden sample), with every problem at its field. Not tried on a real VNA. Guide: docs/sparameters.md. |
ola/pulse_load.py, ola/modules/pulse_load/, frontend/ui/PulseLoadEditorDialog.py |
Pulse on an electronic load (.pls), a built-in measurement module that replaces the Pulse Generator tool: the load makes the pulse in its dynamic mode (high and low current, width, frequency) while the voltage and the current are read and recorded; role load. ola/pulse_load.py (no Qt) has the parameters, the checks, the shape of the pulse and the power of it (ola/pulse_power.py). Before anything is switched on the peak and average power are checked against the limit of the load, with the larger of the working voltage and the voltage read from the load; a pulse above it is refused. Only logical calls are used (set_dynamic_level_high / _low, set_dynamic_timing, enable_dynamic_mode, load_on, disable_dynamic_mode, load_off); the dynamic mode and the load input are switched off at the end, also after an error or a stop. The editor is the form of the module with the preview of the pulse and the checks of the limits of the load (the parameter changed last is corrected). Not tried on a real load. Guide: docs/pulse-load.md. |
ola/modules/tdr/, ola/tdr.py |
Time domain (TDR) (.tdr): where along a cable a fault is, from the reflection S11 of a VNA turned into the time domain (inverse transform with a window): every change of impedance is a peak at a distance (c vf t / 2), with its size, its sign (higher impedance: an open, a damaged spot; lower: a short) and the impedance there. Gives the resolution and the range of the sweep, the length error and the velocity factor that fits a cable of known length, the step response and the impedance profile of a line made of sections, and a pass / fail check on the reflections before the end. ola/tdr.py has no Qt. Guide: docs/tdr.md. |
ola/modules/component/, ola/component.py |
Component impedance (.cmp): an inductor, a capacitor, a resistor or a ferrite with a VNA, connected to ground on port 1 (reflection), in series between the ports (series, for high impedances) or from a thru line to ground (shunt, for low impedances). ola/component.py (no Qt) turns S11 or S21 into Z (impedance), gives the equivalent R, X, L, C, Q, D (equivalent), the self-resonances (self_resonances), the kind (guess_kind) and the method that suits an impedance (best_method); the module checks a nominal value and warns when the method is out of its range. SimComponent in ola/sim_vna.py. Guide: docs/component.md. |
ola/modules/crystal/, ola/crystal.py |
Quartz crystal (.xtl): the Butterworth-Van Dyke equivalent circuit of a crystal or a ceramic resonator in series between the ports of a VNA (series-thru, only S21). ola/crystal.py (no Qt): series_impedance, analyse (the series and parallel resonances fs and fp, Rm, Lm from the slope of the reactance, Cm, C0, Q, the frequency with a load capacitance and its pulling), check_sweep_for (enough points across the resonance). The module reports the offset in ppm from the nominal frequency and a verdict. SimCrystal in ola/sim_vna.py. Guide: docs/crystal.md. |
ola/modules/bode/, ola/sim_bode.py |
Bode plot (.bod): the gain and the phase of a circuit against frequency with a function generator and an oscilloscope (filters and amplifiers at low frequencies, the loop gain of a converter). At every frequency the scope shows both channels from the same capture and a sine of the known frequency is fitted to each (works even under the noise); the vertical scales adjust themselves. Gives the -3 dB bandwidth, the peaking and, for a loop gain, the crossover, the phase margin and the gain margin, with a pass / fail check. The generator is off while the circuit is set up and is switched off at the end also after an error. Needs a function-generator category that the library does not have yet (the calls are in the guide). Guide: docs/bode.md. sim_bode.py is the simulated bench used by the tests. |
ola/resistor_kits.py, frontend/ui/ResistorKitsDialog.py |
Kits of resistors (no Qt in the first): the power resistors of the bench kept once, with name, value, tolerance, power rating and relay, like the cables of the registry, and used in many measurements as {"kit": "PWR", "ref": "R22"}. The project writes the values into the header of the run when the measurement starts. The window (Tools > Resistor kits...) edits them and copies the reference. Guide: docs/resistor-kits.md. |
ola/combinations.py, native/src/combos.rs |
Combinations of resistors for a range of output current (no Qt): from a kit of resistors, an output voltage (fixed, or conversion ratio times the input voltage), a smallest and largest current and a number of points, it finds series / parallel networks (nested, every physical resistor used at most once, all the resistors of the kit available) whose current is as near as possible to equally spaced targets, without a resistor above a share of its rating (default 80 %), and picks among the near ones the path that moves the fewest resistors between one point and the next. The search goes by the number of resistors used, keeping a few ways per band of values (1 % wide), so it does not grow like 3^n: 15 resistors take about 2 s in Rust, 20 about 8 s, and the Python version (same steps and same result, about 15 times slower; OLA_COMBINATIONS=python) is the fallback when the native module is not installed. A 0 A target becomes the first load, the open output ({"open": true} in ola/resistors.py: nothing connected). A converter that is not regulated can be learned first: a quick sweep at the reference input voltage (twice, the second with loads planned from the first) measures the output voltage at each current, the loads are planned again with it (the voltage can be different for each target) and the plan is shown before the measurement goes on. In the editor of the resistive efficiency: Plan from a current range.... Guide: docs/resistive-efficiency.md. |
ola/modules/resistive_efficiency/, ola/resistors.py |
Efficiency with a resistive load (.rfe): the efficiency measurement (same file format and same editor as .eff) whose load is a load parameter made of real resistors: single, or in series / parallel groups, each with its tolerance and power rating, typed in or taken from a kit (and the typed ones can be saved as a new kit). Each load is a point of the sweep (its value is the resistance, with rload_min / rload_max for the tolerances in the formulas); the program switches the outputs off while the load changes and connects it by hand (with a schematic; a switch matrix that wires the resistors in series or parallel by itself is planned for a future version and is shown in the editor as not yet usable); the power in each resistor is checked before the run (max_vout_v) and on every reading. ola/resistors.py has no Qt. Guide: docs/resistive-efficiency.md. SimResistiveBench in sim_bench.py is the simulated converter with relays used by the tests. |
ola/modules/regulation/, ola/sim_bench.py |
Line and load regulation (.reg) of a converter: the output against the input voltage (line regulation in % and mV/V) and against the load current (load regulation in % and the output resistance in milliohms). A supply feeds the input, an electronic load draws the current and a multimeter or a datalogger channel reads the output (and, if asked, the real input at the converter, which shows the drop in the cables). Safe: the load is at 0 A before the supply is on, a test above the limits is refused before anything is switched on, and load and supply are switched off at the end also after an error. A regulation out of limits is a result. Guide: docs/regulation.md. sim_bench.py is the simulated converter, supply, load and meter used by the tests. |
ola/modules/ripple/ |
Ripple and noise (.rpl) of a supply output with an oscilloscope: peak-to-peak and rms of the AC part (AC coupling and 20 MHz limit by default), the frequency of the ripple and its harmonics from the spectrum, the noise left once the ripple is taken away, the worst of several captures, a pass / fail check, and optionally the ripple against load current with an electronic load (switched off at the end, also after an error). Warns when the signal clips the screen, the converter resolution limits the result or the record is too short. Guide: docs/ripple.md. |
ola/modules/attenuator/ |
Attenuator (.att): how much an attenuator attenuates against frequency with a VNA - mean, lowest and highest attenuation, flatness, slope, deviation from the nominal value, the return loss of both ports, the attenuation at chosen frequencies, and a pass / fail check against the nominal value with a tolerance or a mask. For fixed and step attenuators (one setting per run). A value out of tolerance is a result, not an error. Guide: docs/attenuator.md. |
ola/modules/amplifier/ |
RF amplifier (.amp) with a two-port VNA: gain (peak, flatness, 3 dB band), input and output return loss, reverse isolation, the stability factors K and mu (can it oscillate? and in which bands), and optionally the 1 dB compression point from a power sweep. Protects the amplifier and the VNA: a power above the amplifier's maximum input is refused before anything is sent, and the source power is put back after the compression test, also if it fails. Guide: docs/amplifier.md. |
ola/modules/antenna/ |
Antenna impedance (.ant): S11 of an antenna read as an impedance - R + jX against frequency, the Smith chart (the view the window opens with), the resonances (series and anti-resonances), the best match, the usable band and its fractional bandwidth, and at chosen frequencies the impedance and the series component that would cancel the reactance. Guide: docs/antenna.md. |
ola/modules/filter/ |
Filter (.flt): the response of a low-pass, high-pass, band-pass or band-stop filter with a VNA - insertion loss, cut-off or band edges at -3 dB below the peak, bandwidth, centre and Q, notch depth, passband ripple, gain at chosen frequencies, group delay, return loss, and a pass / fail mask on the gain. An edge outside the sweep is reported, not invented. Guide: docs/filter.md. |
ola/vna_common.py, ola/modules/return_loss/ |
What the VNA measurements share (sweep and common parameter checks, the question about calibration and connection, setting the sweep, reading and averaging S-parameters, normalising the data) and Return loss / VSWR (.rtl): S11 against frequency - return loss, VSWR, impedance, the best and worst match, the bands where the VSWR stays under a limit (the bandwidth of an antenna), pass / fail on the return loss. Guides: docs/return-loss.md and, for the library, docs/vna-calls.md (the calls of the network analyzer category). The same parameters everywhere: check_common checks z0 (the reference impedance of the VNA, also written in the Touchstone export), require_calibration (with it acquire stops at the first sweep when the data are not calibrated or a parameter read is not corrected) and group_delay_aperture (ola.rf.group_delay_s(..., aperture)); upgrade_params / upgraded read the old names of a few fields (also_return_loss, gain_edge_db, the flat sweep of the S-parameters file), each module calls them when it is built and the editor when it opens a file. Manual reversal (acquire(..., manual_reversal=True), acquire_reversed): with a VNA that drives port 1 only, S22 and S12 are read by asking the operator to turn the device round (ask_forward_again to put it back); it needs also_reverse on (amplifier). |
ola/modules/cable/, ola/sim_vna.py |
Cable characterization (.cbl): the loss of an RF cable against frequency with a VNA (calibrated beforehand by the user) - insertion loss in dB and per metre, loss at chosen frequencies, group delay and velocity factor, return loss, and a pass / fail check against a limit; transmission (S21) or reflection (S11 with an open or short). Its editor comes from its form.json and warns when the sweep is too coarse for the cable. SimVna is a simulated VNA with a cable to try it without hardware. Guide: docs/cable.md. |
ola/label_design.py, frontend/ui/LabelDesignDialog.py |
The label of each kind (see the row below): one label size for every kind and, per kind (cable, attenuator, amplifier, adapter, antenna, filter, converter, generic), a ready-made design the user can change in two ways: automatic (free lines, as the templates) or manual (every text and the QR code an element with its position in mm, width, letter height, bold and alignment; drag it in the preview or type the numbers). The attributes of each kind are places with their unit ({nominal_db} = 10 dB). The elements of a manual design are texts, the QR code, boxes (frames) and lines (rules, dashed fold marks). The layout cable flag builds a label for a cable from the size of the label and the diameter of the cable: a blank part that goes round the cable (pi x diameter + overlap), then two faces with the same design either side of a dashed fold, a dashed line where the wrap ends. Every label is checked for overlaps (a text over another text or over the QR code, outside the label, crossed by a line or a frame edge) and the problems are listed under the preview; a regression test lays out every kind at many sizes, layouts and rotations and fails on any overlap of the automatic layout. Label stocks (50 x 80 and 50 x 40 mm for the CLabel, Brother QL rolls...), the printer resolution and turning the output for a printer that feeds the label the other way are in the tool; a tall label puts the QR code above the text. The QR code is left out when it does not fit (with a note saying how big the label must be to have it) and the tool guides the user (lines that do not fit, text too small, a tall label that would suit a 90 degree turn); small labels down to 10 x 8 mm work. Texts can be rotated 0/90/180/270 degrees (each text of a manual design, or the whole automatic design). The label window saves PDF at the real size, SVG in millimetres (Inkscape, LibreOffice Draw), PNG at the dpi of the printer (203/300/600, real size in the file: brother_ql, ptouch-print) and every label as a file of its own. The first format of the label window, By type, draws each card with the design of its kind. See docs/assets.md. |
ola/label_templates.py, frontend/ui/LabelTemplateDialog.py |
Your own label templates (see the row below): a name, a size in mm, single label or flag, QR and border, and free lines of text with the data of the card between braces (Rev {version}, S/N {serial}); a line with nothing to show is not printed, the code {id} must be in a line, the QR content stays OLA:<code>. Kept in one file (~/.open_lab_automation/label_templates.json or OLA_LABEL_TEMPLATES), written atomically; a damaged file is reported and never overwritten. The window Templates... of the label window edits them with a live preview. See docs/assets.md. |
ola/assets.py, ola/duts.py, ola/variants.py, frontend/ui/VariantTable.py, ola/labels.py, frontend/ui/label_paint.py, frontend/ui/AssetsDialog.py, frontend/ui/DutsDialog.py, frontend/ui/DutEditDialog.py, frontend/ui/DutVersionsDialog.py, frontend/ui/AssetEditDialog.py, frontend/ui/LabelDialog.py |
The registry of cables and devices and their labels, and the archive of the devices under test (ola/duts.py: antenna, filter, converter, generic; code DUT-0001, a name, versions in free text; the migration of the antenna and filter cards; window Tools > DUT, the DUT in the measurements, see docs/duts.md). Every physical object measured (cable, antenna, filter, amplifier, attenuator, adapter...) has a code (CBL-0042, never reused) and a card, in one JSON file shared by all projects; the runs that used it are found by the code they saved. A label shows the code, a QR code (OLA:CBL-0042, a normal QR, not a Micro QR) and a few lines of text, drawn in millimetres: a single label, a flag for a thin cable (the same text either side of a fold) or a sheet of labels on a normal printer (skipping the labels already used); written as SVG, PDF at the real size, or PNG. Lines that do not fit are reported, not hidden. Needs segno. Windows: Tools > Cables and devices (cards, scan a code, history with Compare, labels); the measurement editors pick the code from the registry and every run keeps the card of that day. Guide: docs/assets.md. |
ola/golden.py, scripts/golden_check.py |
Check against a golden sample (no Qt): a run of a unit known to be good is kept in the golden/ folder of the project, and a new run is checked against it. Each curve may differ from the golden one by a tolerance (a number, a line of the frequency, or asymmetric: more loss is the failure, less is not) and each figure of the summary by an absolute and / or relative tolerance; a run that covers too little of the golden sweep fails. The answer is PASS / FAIL with a sentence for each reason, and the script gives it as an exit code. The same in the Golden sample tab of the comparison window, and as a step of every measurement but the time log (golden in their file: golden_verdict in the result; the measurements that give a table of rows, ripple, regulation, efficiency, S-parameters, pair the rows by a column). The tolerances can be worked out from a few good units (derive_tolerances, Suggest from the ticked runs). Guide: docs/golden.md. |
ola/trend.py, scripts/cable_trend.py |
How a cable ages (no Qt): the loss of a cable (the worst, or at a frequency of interest) against the date of the runs that used its code, a least-squares line with its uncertainty (a change counts only if the slope is more than twice that), and a verdict before the cable is out of use: FAIL past the limit or too fast, WARNING with the date the line reaches the limit, NOT ENOUGH DATA with fewer than three measurements. Drawn in Trend... of the history of a cable (frontend/ui/TrendDialog.py). Guide: docs/trend.md. |
ola/compare.py, frontend/ui/CompareDialog.py |
The Compare results tool (Tools menu, and Compare... in the project window): pick two or more saved runs and see them together - the curves they have in common overlaid, in dB / loss / phase / on the Smith chart, or the difference from a reference run with its largest value, mean and RMS; the summary figures side by side with the change from the reference; and, for runs with many points, any column against another. Export to CSV and PNG. Guide: docs/compare.md. |
ola/wiring.py, frontend/ui/WiringDialog.py, ola/modules/*/wiring.json |
The connection diagram of a measurement: which instrument goes where, from a wiring.json that each module brings (so it is updated with the module) and from the parameters of the file (the amplifier shows its attenuator only if it has one, the cable its open or short end...). It is a picture (your own drawings dropped next to the module, or a diagram drawn by the program) and a numbered list of what to connect to what, written from the file (connect channel 101 of daq1 to «vin»). Shown before a measurement starts (Start / Cancel, with a tick to turn it off) and by the Connections... button of the project window; written as SVG. Every picture has a placeholder in its module folder (scripts/make_picture_placeholders.py writes them from the work list docs/wiring-images.md): the program ignores it until it is replaced by a real drawing. Guide: docs/wiring.md. |
ola/matching.py |
Matching networks (no Qt): the two-component L networks that make a load R + jX look like z0 at one frequency (networks: both shapes, every solution with its input impedance and its loaded Q; component turns a reactance into the inductor or capacitor that gives it; describe writes it from the source to the load). The antenna and the return loss measurements report them at their match_frequencies_hz (summary_at, checked by check_frequencies). |
ola/fixtures.py |
Taking cables, adapters and pads out of a transmission measurement (no Qt): a device measured through a cable, an adapter or a pad on port 1, port 2 or both. The fixture (named by its registry code, a cable or attenuator run, or a .s2p file written as seen from the VNA) is taken out, so the result is of the device alone. Matched model (the fixtures only attenuate: S21 / (T1 T2)) or full (the fixtures have reflections: transfer matrices, exact for any fixture; reads all four S-parameters), complex or magnitude mode. Used by the filter and attenuator measurements through correction, which keep the raw curves. Guide: docs/deembedding.md. One port too (deembed_one_port, correct_reflection_trace): the reflection measurements (return loss, antenna, cable in reflection) use the same fixtures, correction.port1 (or correction.cable, the name used before): matched divides by the round trip S21*S12 (a cable measured in reflection gives it with its phase: the numbers of the cable correction of before), full also takes out the reflections of a pad or an adapter. The amplifier and the cable take fixtures out too; the compression test of the amplifier as losses at its frequency (losses_at). |
ola/deembed.py |
Taking a cable out of a reflection measurement (no Qt): an antenna or a device measured at the end of a cable looks better matched than it is, because the cable's loss weakens the reflection twice. With the cable already measured (by its code in the registry, a cable run file or a Touchstone file) the reflection of the device alone is S11 measured / T^2, with the phase (complete, so the impedance and the Smith chart are corrected too) or with the loss alone (VSWR and return loss). The return loss and antenna measurements use it through their correction parameter and keep the raw curves beside the corrected ones. Guide: the section Through a cable of docs/return-loss.md. The correction itself is now done by ola.fixtures (corrected_reflection_for hands it over); this module reads the cable measurements (load_cable_run, from_reflection, ...) and checks the parameters (check_correction accepts port1 or cable, with mode and model). |
ola/spectrum.py, ola/sim_scope.py |
spectrum.py (no Qt): the amplitude spectrum of a sampled signal (Hann window, numpy when installed, plain Python otherwise), the peaks in it and the noise outside the peaks; used by ripple and noise and by the measurements to come that look at a signal in frequency. sim_scope.py: a simulated oscilloscope on a switching supply (ripple, spikes, noise, AC coupling, bandwidth limit, converter resolution, screen clipping) and a simulated load, to try the oscilloscope measurements without hardware. |
ola/rf.py, ola/limits.py |
Shared by the RF measurements (no Qt): dB, insertion / return loss, VSWR, impedance from the reflection coefficient, group delay and velocity factor, a curve at one frequency, level crossings (the -3 dB points), Touchstone .s1p/.s2p reading and writing; and pass / fail limits on a curve (a constant, a line, or one limit per band) that turn a result into a verdict. ola.runs exports the traces of a run to CSV and Touchstone. |
ola/drivers/ |
Drivers for instruments without text commands (access: driver in the library; driver_id names the driver, driver_for builds it on the open connection). litevna.py: the binary register protocol of the LiteVNA. waveforms.py: the waveform generator and the oscilloscope of the Digilent Analog Discovery through the WaveForms runtime (the dwf library, ctypes): the logical calls of the function generator category (set_output_state, set_frequency, set_amplitude, set_offset, set_waveform_shape) and of the oscilloscope category (channels, timebase, depth, run_acquisition, stop_acquisition that completes the capture, read_waveform, trigger), so the Bode measurement can use one device for both; a generator and a scope with the same address share the open device; the connection is the address DWF (first device) or DWF::<serial number>, opened by open_visa without VISA. Experimental: the meaning of the amplitude (peak or peak-to-peak) and the numeric constants of dwf.h are to be verified on a device (see Instruments_LIB/docs/proposals/function-generator-calls.md). Tests use a stand-in for the library. |
ola/vna_calibration_flow.py |
Guided calibration of a network analyzer, the same for every VNA (no Qt, no terminal): a list of steps (connect a standard, measure it) walked by CalibrationSession with the logical calls calibration_begin, calibration_measure and calibration_apply, for an instrument that calibrates itself and for one whose driver calibrates in software. A finished calibration is saved as a .cal.json record next to the project and listed in the project file; a software calibration can be restored for the same sweep. A calibration belongs to one apparatus (its serial number, read from the instrument): before a run ProjectSession restores the saved software calibration of that VNA when it was made for the sweep of the measurement (find_record, auto_restore; the snapshot of the run says restored); a calibration of another serial number, or an instrument that gives none, is never used. The Calibrate VNA... window (frontend/ui/CalibrationDialog.py, a button of the project window; strings frontend/lang/modules/calibration/<lang>.json) is a thin layer on it: instrument, kind, ports, sweep and an optional calibration kit with parasitics, then one standard at a time; the result is saved in calibrations/ and listed in the project file. The kinds (KINDS, KIND_PLAN): the library's thirteen, from a one-sided normalisation to TRL, each with its list of standards (plan_steps); a model offers only the ones in its calibration_kinds, and CalibrationSession refuses any other before it sends anything. With an electronic calibration unit (ecal=True, the model's ecal_kinds) the session has no standards to measure: one calibration_ecal call does it all. The list of kinds, the standards and the commands of each series are in the library: Instruments_LIB/docs/vna-calibration-types.md. |
ola/vna_calibration.py |
Software calibration of a network analyzer that returns raw data (the LiteVNA), no Qt: the raw sweeps of the calibration standards (open, short, load, thru) give the error terms per frequency (three for a reflection, the thru for a transmission response) and the correction is applied to every following sweep. The standards are ideal: the offsets and the fringing capacitance of a real kit are ignored. |
ola/role_mapping.py, frontend/ui/RolesDialog.py |
Using a project received from someone else with your own instruments (no Qt for the logic). The measurements name the instruments of the sender; find_gaps lists the names that are not in your instrument file with the kind each role asks for, candidates_for your instruments of that kind, preview what a candidate would have less than the one used (ola/compat.py, a sweep it cannot do blocks), map_instrument names your instrument in the measurements (ola/project_rename.py). The window is offered when a project is opened with names you do not have and from File > Use my instruments.... Runs already made keep the sender's instruments; a calibration made for another apparatus is not used. |
ola/compat.py, frontend/ui/CompatibilityDialog.py |
What an instrument can do and what a measurement asked of it (no Qt). characteristics(library, model_id) gives only the numbers the library really has (max voltage / current / power, bandwidth, frequency range, ports...); a handle remembers the largest value of each quantity it was asked to set or gave back during a run (observe), the end of the run file keeps it (observed), and the need of a role is learned: the largest value observed in the runs of the measurement plus 20 % (role_need). Modules declare nothing. check_role compares the instruments now bound to a role with the ones of the previous runs (and the learned need): ProjectSession.compatibility before a run, and frontend/ui/CompatibilityDialog.py shows what an instrument has less of (this one / previous / needed so far); the user goes on or cancels, and what was accepted is written in the run (accepted_differences). For a network analyzer, a sweep that starts below, ends above or has more points than the model allows blocks the run (the pop-up shows the limit of this instrument, of the previous one and what the sweep asks); S-parameters read or the source power set in the previous runs that the model cannot do are only a warning (check_network_analyzer; ProjectConnector.abilities). Design: docs/proposals/instrument-identity.md. |
ola/control_panels.py |
What the remote-control panels show (no Qt): the controls of an instrument are only the logical calls its model defines in the library (a generator without an output switch has no output button; only the waveforms the model translates are offered), with its channels and limits; the values typed in a panel are checked here before anything is sent. Used by the function-generator panel of the Remote control tab (frontend/ui/FunctionGeneratorPanel.py). |
ola/rf_controls.py |
What the remote-control panel of an RF signal generator shows, and the calls it sends (no Qt): the carrier (frequency, power, RF output, checked against the model's ranges) and, for each modulation the model defines in the library (AM, FM, PM, pulse), its on/off state, the source (internal 1 or 2, external), the rate of an internal generator, the depth (AM) or deviation (FM, PM), the waveform and the coupling of the external input; only what the model translates is offered, and a modulation is configured before it is switched on. Used by frontend/ui/RfGeneratorPanel.py in the Remote control tab. |
ola/readings.py |
The readings an instrument has inside (no Qt): readable_calls(library, model) lists the read_... and measure_... calls of a model that give a number, with the unit and whether the call takes a channel (channel_number, as the outputs of a supply) or needs other arguments; the status and calibration queries are left out. call_arguments says what a logical call takes. Used by the editor of the time log (frontend/ui/TimeLogEditorDialog.py) and by the time-log module, which passes the channel of a reading as an argument or selects it first (multichannel load). |
ola/vna_coverage.py |
What a calibration corrects (no Qt): for a calibration kind and its ports (coverage, levels) the level of correction of each S-parameter (none, normalisation, partial, full); problems compares it with the parameters a measurement reads and gives the sentences for the log (a parameter that is not corrected; a reflection with a normalisation only). ola.vna_common.acquire does the check at the first sweep from the calibration the program made (handle.calibration: the one it restored, or, for a VNA that keeps its own calibration, the newest record of that apparatus in this power session, note_kept_calibration). Advisory: nothing is blocked. |
ola/vna_power_state.py |
Is the calibration a VNA keeps itself still valid? (no Qt; issue 129). A VNA that keeps its own calibration (Siglent, Rohde & Schwarz: no calibration_import) loses it when it is switched off. The program keeps per apparatus the state "calibrated in this power session" (PowerState): a calibration made in the calibration window sets it; the presence probe (ola.identity.probe_presence, an identification_query outside the measurements) clears it when the instrument does not answer, and it stays cleared when the instrument answers again, until the next calibration. The probe runs at the start of a measurement (ProjectSession._restore_calibrations) and at every sweep of the VNA panel. A missing or lost calibration is reported, never blocked: a message before the run, a warning in the log, calibration_lost in the header of the run file and a note in the panel. A software calibration (LiteVNA) is forgotten too: its record stays in the project (when and how it was made), but it is put back before a run or a panel sweep only for an apparatus calibrated in this run of the program that did not stop answering since; a VNA that does not answer drops the calibration applied to its connection. A switch-off and switch-on between two probes is not seen. |
ola/identity.py |
Who an instrument is (no Qt): the identity read from the apparatus (*IDN?: manufacturer, model, serial number, firmware; for a serial-port device without one, the serial number of its USB descriptor), never typed by hand; a manual instrument has no serial. snapshot(handle) is what the header of every run file keeps for each instrument (instruments: name of that day, model, serial, calibration applied), so a saved measurement stays linked to the apparatus that made it. A calibration record carries the serial number of the apparatus it was made for. Design: docs/proposals/instrument-identity.md (pull request for the proposal). |
ola/vna_controls.py |
What the remote-control panel of a vector network analyzer shows, and the sweep it runs (no Qt): the S-parameters the model measures, the sweep within its frequency and point limits (frequencies typed as 2.4G, 100k...), IF bandwidth, source power and logarithmic sweep only when the model has those calls. The sweep goes through ola/vna_common.py, like the VNA measurements, so a LiteVNA (driver) and an analyzer with SCPI behave the same; curves in dB or as impedance (R, X) of the reflection traces, min/max markers, Touchstone export. Used by frontend/ui/VnaPanel.py in the Remote control tab. |
ola/inst_complete.py |
Every entry of the .inst file complete (no Qt): complete_entry / complete_entries add what the library says the model has and the entry lacks (channels of a supply, load, multimeter or oscilloscope with the limits of the model, the slots of a datalogger or a switch unit, the ports and usual sweep of a network analyzer); nothing already in the entry is changed. The editor does it when it opens the file (and saves it if something was added) and at every save, so an instrument that was only added, for instance by the network scan, is complete without opening it. |
ola/inst_file.py, frontend/ui/InstrumentConfigDialog.py, frontend/ui/InstrumentPanels.py |
The instrument file (.inst) and its editor. inst_file.py (no Qt) reads and writes the file keeping the keys it does not know, and checks every entry: name missing or used twice, no address or model, model not in the library, no enabled channel, limits missing or above what the model can do, serial settings and timeout out of range, a VNA without ports or with a sweep outside the model. The editor shows these problems under the instrument (a warning sign in the list) and offers, besides the channel tables (now with the optional max power): the timeout, the RS-232 settings that differ from the library (serial, used by ProjectConnector and by the remote panel), the ports and the usual sweep of a network analyzer (num_ports, ports, sweep; the calibration window starts from them) and the module in each slot of a switch unit. A file that cannot be read is never overwritten. Strings: frontend/lang/<lang>.json (keys inst_*). |
ola/project_rename.py |
Renaming an instrument without breaking the measurements (no Qt). A measurement names the instrument of each role (role_bindings); when the name changes in the .inst file, find_references lists the measurements of every project that uses the file (for the preview shown by the editor) and rename_references names the new one, keeping every other key of the files and putting the files back if one cannot be written. The editor renames when the field is finished, asks first if measurements are affected, and refuses an empty or used name. Run files are never touched: they keep the name of that day (see ola/identity.py). |
ola/load_controls.py |
What the remote-control panel of an electronic load shows, and the calls it sends (no Qt): the modes its set_mode translates (CC, CV, CR, CP), the readings and the protections (OVP, OCP, OPP) the model has; load calls have no channel argument, so on a multi-channel load select_channel comes first. A setpoint is checked against the limits of the channel in the .inst file before it is sent. Used by frontend/ui/ElectronicLoadPanel.py in the Remote control tab. |
ola/connection.py, frontend/ui/manual_prompt.py |
How a project reaches its instruments (the connect of the project window): ProjectConnector reads the .inst file and gives the handle of an instrument - a manual one (the operator is asked, in a pop-up, to do the action by hand) or one opened from the library at its VISA address (USB, LAN, GPIB, serial). Connections stay open between runs; every problem is a sentence that says what to check. See docs/engine.md. |
ola/run_replay.py, frontend/ui/ProjectFilesList.py |
Runs under a measurement in the sidebar: ProjectFilesList is the file list of the main window; a measurement that has runs gets a small arrow that shows or hides its runs under it (newest first, a run that did not finish in italics). Double click (or Open this run) replays the run in the run window: ReplayRunner (no Qt) reads the run file and gives the same events as a live run. Delete this run... asks first and deletes the file and its waveform folder from the disk. |
ola/project_session.py, frontend/ui/ProjectWindow.py |
The window of a project (format 2: one file per measurement): the list of its measurements, New (type chosen among the measurement modules), Edit (the efficiency editor for .eff, a validated JSON editor for other types), Start measurement (opens the run window; results go to runs/ in the project folder), Rename, Remove, the runs already made with CSV export. The logic is in ProjectSession (no Qt); the instruments come from the application through connect(name) -> handle. Strings: frontend/lang/modules/project/<lang>.json. Try it: python -m frontend.ui.ProjectWindow [project.json] (no argument: a demo project with simulated instruments). See docs/engine.md. |
ola/run_view.py, ola/demo_lab.py, frontend/ui/RunWindow.py, frontend/ui/plot_widget.py, frontend/ui/trace_plot.py |
The window that runs a measurement: a model without Qt (RunModel: state, progress and time left, table, log, open questions, series for plots) and a thin PyQt6 window with Start / Pause / Stop, a live table, a plot (any column against any other, one line per value of a third), a Curves tab (traces with magnitude / loss / phase / Smith chart views, logarithmic axis, limit lines, CSV and Touchstone export), the log and pop-ups for the questions of the measurement. Strings: frontend/lang/modules/run/<lang>.json. Try it with simulated instruments: python -m frontend.ui.RunWindow (add --fault to see the pop-up). See docs/engine.md. |
ola/efficiency_editor.py, frontend/ui/EfficiencyEditorDialog.py |
The editor of the .eff file: a model without Qt (EfficiencyEditor: add / duplicate / move / rename parameters, sweeps, formulas, power order, live problems) and a thin PyQt6 window on top of it. Strings: frontend/lang/modules/efficiency/<lang>.json (en, it, fr, es, de). Try it: python -m frontend.ui.EfficiencyEditorDialog [file.eff]. See docs/efficiency.md. |
ola/efficiency_spec.py, ola/formula.py, ola/sweep.py, ola/modules/efficiency/ |
The efficiency measurement (.eff): ordered list of parameters (set / sweep / read), averaging, formulas such as 100 * pout / pin (safe: never eval), live validation for the editor dialog, and a question to the user (retry / abort / skip) when a reading disagrees with the setpoint. Guide: docs/efficiency.md. |
ola/bench.py |
Benchmark mode (OLA_BENCH=1): times every instrument call (planning, lock wait, steps, instrument response, delays, interpretation), the phases and the publishing of results, and gives a report at the end of a run. Guide: docs/benchmark.md. |
ola/errors.py, ola/call_errors.py |
Exceptions with a stable code: TRN-xxx (transport) and CALL-xxx (calls); see ERROR_CODES.md. |
Guides (in docs/): how a run works, events, files and guarantees · writing a measurement module · instrument calls, steps, transports and RS-232 notes · benchmark mode: where the time goes.
Why a new transport. The former C backend (removed) needed about 44 ms per SCPI query on loopback (Nagle + delayed ACK: no TCP_NODELAY, command and terminator sent separately). The new transport needs about 35 µs (Rust) or 55 µs (pure-Python fallback); see benchmarks/bench_transport.py. On real instruments a query costs 1-50 ms, so the instrument dominates; the engine's job is to add nothing on top.
Project format (v2). <project>.json has "format_version": 2 and a measurements list (id, type, name, file). Each measurement lives in its own file whose extension is defined by its module (.tlg for the built-in time log). The instruments (inst_file) and the settings of the oscilloscopes (scope_settings, a .was file) are project definition files, not measurements; scope_settings is an ordered list of .was files, each one an acquisition that can be switched off (the project may have none), and the remote control asks which of the files that are on to apply. A project file of the old format (no format_version) is updated only after the program asks: the original is first copied byte for byte to <name>.json.bkp (.bkp.1, ... if that exists, a backup is never overwritten), then the file gains the format number and its eff_files become measurements (each old file is copied to <name>.bkp first; the old files only said which quantities to sweep, so the instrument call of each one is to be chosen in the editor, and the program lists it). Answering No leaves everything untouched and the project is not opened. The was_files key of the early projects is read and no longer written.
Writing a measurement module. A folder with a module.json (id, name, version, api_version, unique extension, entry, roles, params_schema) and a Python file with a Measurement subclass. Instruments are only reached through ctx.instrument(role).call(name, **args). See ola/modules/time_log/ for a complete example. The same module is the time log (.tlg) measurement, a value read at a fixed interval: docs/time-log.md. Modules are searched in ola/modules/ (built in), ~/.open_lab_automation/modules/ and <project>/modules/.
Build, test, benchmark
pip install maturin
cd native && maturin build --release && pip install target/wheels/ola_native-*.whl # optional: fast transport
cd native && cargo test # Rust tests
pytest tests # Python tests (native and pure-Python transport)
python benchmarks/bench_transport.py
python benchmarks/bench_engine.py # whole engine on a simulated instrument (see docs/benchmark.md)
python benchmarks/bench_hardware.py --model ID --address VISA # one real instrument, queries onlyError codes of the engine are TRN-xxx (transport) and CALL-xxx (calls); see ERROR_CODES.md. The design and the project status are in PLAN.md.
frontend/launcher.py— Application launcher with environment setupfrontend/main.py— Application entry point (PyQt6)frontend/ui/main_window.py— Main window, menus and project file listola/— Qt-free code shared by the GUI and the terminal tools: instrument library loader and call planner, instrument handles, manual instruments, transport, measurement core
Instruments_LIB/— The instrument library (git submodule, mede-erik/Instruments_LIB)instruments_lib.json— All supported modelsschema/— The logical calls of each category (the contract between the software and the library) andschema/README.md(format of a library entry)COMMAND_NAMES.md— Mandatory and optional calls of each categoryTESTING.md— How to test an instrument of the library and report the result
frontend/ui/— Dialog boxes and UI components (one file per window)RemoteControlTab.py— Remote control panelGpibAdapterDialog.py,GpibDevicePickerDialog.py— GPIB adapter profiles and the instrument picker on the GPIB bus (guide:docs/gpib-adapters.md)InstrumentConfigDialog.py— Instrument configuration editor (library and manual instruments)WasFileDialog.py— Oscilloscope settings editor (channels, timebase, trigger)AddInstrumentDialog.py— Three-level instrument selection (type → series → model)AddressEditorDialog.py— Guided VISA address compositionDataloggerSlotConfigDialog.py— Slot-based module configuration for modular dataloggersPulseLoadEditorDialog.py— Editor of the pulse on an electronic load, with the preview of the pulseHexDecConverterDialog.py— Hex/Dec/Bin converter
scripts/instrument_shell.py— Interactive instrument tester (see below)scripts/dry_run_call.py— Shows the commands a logical call or a.wasfile would send to a model, without hardwarescripts/check_translations.py— Checks that the five language files have the same keys and that every key used in the code exists
frontend/lang/it.json,en.json,fr.json,es.json,de.json— Translations for the GUIfrontend/core/Translator.py— Translation management system
frontend/core/— Core modules for error handling, validation, translations, logging and utilitiesLoadInstruments.py— Instrument library interface used by the GUIerrorhandler.py— Centralized error handling with standardized error codes ([RESOURCE-XXX] format)validator.py— Input validation functionsgpib_settings.py— Saved GPIB adapter settings (seedocs/gpib-adapters.md)tools.py— Reusable utility functionsTranslator.py— Multi-language translation system
README.md— This documentation fileLICENSE— License information (GPL v3)ERROR_CODES.md— Complete reference of standardized error codesPLAN.md— Design decisions and development statusCLAUDE.md,AGENTS.md— Guidance for code assistants (commands, architecture, rules)Instruments_LIB/docs/— Instrument manuals and documentationexamples/— Example projects and configuration files
Symptoms: the instrument is plugged in and lsusb lists it, but VISA (NI-VISA or pyvisa-py) lists no
USB0::...::INSTR resource, the automatic search of the instrument window finds nothing, and
pyusb fails on the string descriptors with The device has no langid (permission issue ...).
Cause: the kernel usbtmc driver takes the instrument, and its device node in /dev/bus/usb/ is owned
by root:root with mode 0664. The user cannot open it, so the VISA backends cannot read the
instrument's identity and do not list it. The instrument itself is fine: /dev/usbtmc0 answers *IDN?.
Check that the kernel driver holds it, and that the device node is the problem:
lsusb # find the vendor:product ids of the instrument
ls -l /dev/usbtmc* # the kernel driver created a node
ls -l /dev/bus/usb/<bus>/<dev> # root:root 0664 = the VISA backend cannot open itFix: a udev rule that gives the device to a group the user belongs to (here plugdev). Replace
<vendor-id> and <product-id> with the ids from lsusb, without the 0x prefix; do not add the serial
number, so the rule works for every unit of the model:
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="<vendor-id>", ATTR{idProduct}=="<product-id>", MODE="0664", GROUP="plugdev"' \
| sudo tee /etc/udev/rules.d/99-usbtmc-instrument.rules
sudo udevadm control --reload-rules && sudo udevadm trigger --subsystem-match=usbThen unplug and plug the instrument again. Check that id -nG lists plugdev, and that VISA now lists
the instrument as USB0::0x<VENDOR>::0x<PRODUCT>::<serial>::INSTR.
Notes:
- The rule is for the instrument model. A different model needs its own ids.
- A VISA resource is usually
USB0::, so the instrument window must be set to that resource, not to the/dev/usbtmc0node, which the VISA backends do not use. - If the instrument is also reached over LAN, the LAN address is not used by the USB connection: a "no route to host" error on the LAN address does not mean the USB connection is broken.
What still has to be tested on real hardware (or was only partly tested). A box is checked
only when the feature was run on the real instrument, not when only the simulated bench passed;
write the instrument model next to the checked item. A feature with sub-items is checked only when
all of them are. Software only: the status of the library is in Instruments_LIB.
- USB-GPIB adapter (Agilent/Keysight 82357B) through the GPIB adapter tool
- on Windows (Connection Expert output)
- on Linux (kernel and
linux-gpibsetup)
- LAN (LXI), USB-TMC and serial connections from the instrument editor
- Serial settings overridden per instrument (baud, parity, stop bits, flow control)
- Power supply and electronic load control
- Oscilloscope settings from a
.wasfile - Waveforms during an efficiency measurement (the scope settings files that are on, one after another; binary files next to the run; trigger forced when it does not arrive)
- two oscilloscopes at once, each file for its oscilloscope
- capture when a quantity crosses a limit
- alignment of two oscilloscopes after the run through a shared signal
- GW Instek GDS-1000B oscilloscopes (no instrument tested)
- settings of channels, timebase and trigger
- waveform:
read_waveform,query_waveform_preambleandquery_waveform_data(settings text and samples in one message)
- Datalogger from an
.instfile- scan list and channel functions
- per-channel range, integration time and input impedance
- temperature channels: probe (thermocouple, RTD, thermistor), sensor type and integration time
- RTD as PT100 and PT1000 (nominal resistance)
- guided zero with shorted inputs (before a measurement starts)
- RF signal generator panel (AM, FM, PM and pulse modulation)
- Spectrum analyzer: the instrument can be added from the library and its logical calls run (trace, markers); there is no panel for it yet
- Efficiency sweep (power supply and electronic load)
- converter under test written in the file (
device, optional; devices under test get their own database later)
- converter under test written in the file (
- Line and load regulation (multimeter, datalogger)
- Ripple and noise
- RF with a VNA
- S-parameters and return loss
- editor of the
.spmfile (S-parameters as tick boxes)
- editor of the
- filter, amplifier, attenuator, antenna
- amplifier on a forward-only VNA (
also_reversefalse): gain, band and input match without S12 and S22 - manual reversal of the device on a forward-only VNA (LiteVNA): S22 and S12, the stability of an amplifier
- matching networks of an antenna (
match_frequencies_hz): the L network built and measured again
- amplifier on a forward-only VNA (
- a required calibration (
require_calibration) stops the run when the VNA says the data are not corrected - S-parameters (
.spm) with the common sweep block, averaging and the set-up question; a file of the old form still opens - cable with de-embedding of cables and pads
- one-port de-embedding of a pad or an adapter with the full model (return loss, antenna)
- fixtures taken out of the amplifier (and of its compression test) and of the cable measurement
- time domain (TDR), fault position along a cable
- component impedance (L, C, R)
- series-thru on an inductor, shunt-thru on a capacitor, reflection on a resistor
- self-resonance and the nominal check against a component of known value
- quartz crystal: fs, fp, Rm, Lm, Cm, C0, the frequency with a load capacitance
- calibration kept by the VNA itself (Siglent, R&S): the program notices a switch-off and reports it
- presence probe at the start of a measurement and at every sweep of the VNA panel (timeout per model)
- warning before the run, in the log and in the run file (
calibration_lost); the run is not blocked
- LiteVNA: the calibration is forgotten when the program is closed or the VNA is switched off (to be calibrated again)
- calibration kinds beyond OSL and thru (from the manuals, never tried on an instrument)
- reflection or transmission normalisation, enhanced response (Siglent SNA/SHN, R&S ZNx/ZVx)
- two ports with an unknown thru (UOSM), TOM, TSM, TRM, TNA (R&S)
- TRL (Siglent, R&S)
- warning in the log when a measurement reads a parameter the calibration made with the program does not correct
- calibration with an electronic calibration unit (Siglent, R&S ZNx)
- S-parameters and return loss
- Bode plot with a generator and a scope (bandwidth, phase and gain margin)
- Pulse on an electronic load (
.pls, replaces the Pulse Generator tool)- the pulse made by the dynamic mode of the load, with the voltage and the current read during it
- a pulse above the power limit refused before anything is switched on
- the load switched off after an error and after a stop
- editor: preview and correction of the parameter changed last
- Time log of a variable
- several instruments, each at its own interval, one table per instrument
- datalogger read with one scan of all its channels
- readings inside a supply (voltage and current of a channel) and an electronic load (voltage, current and power)
- multichannel load: the channel selected before each reading
- editor of the sources, with the calls of the library
- datalogger channels ticked from the instrument file (with attenuation)
- Resistive-load efficiency (same file and editor as the efficiency)
- manual connection of each load, with the schematic
- the safety check of the power in the resistors on every reading
- resistors from a kit, and typed-in resistors saved as a new kit
- loads planned from a kit for a range of output current (fixed or ratio-based output voltage)
- the 0 A point: output left open (by hand and by relays)
- learning of a converter that is not regulated (quick sweep, plan again, confirm)
- Golden sample comparison and cable trend
- Wiring diagrams shown before each run
- Results saved in
runs/(JSON Lines) and exported to CSV (and Touchstone for RF)
- Project files
.json,.inst,.eff,.was,.cbl,.flt: create, edit and reopen - Cable and device registry with labels
- Runs under a measurement file in the sidebar (small arrow, only when the measurement has runs)
- open a run with a double click: it is replayed in the run window
- delete a run (asks first; the file and its waveform folder are deleted from the disk)
- DUT archive (window Tools > DUT)
- create, edit, retire and delete a DUT; versions in free text
- labels of the DUTs (code, QR, name, version, key figures)
- your own label templates (Templates... in the label window: size, lines with
{name},{version}..., printed on the real printer) - label design per kind (Label design...: one size, the ready-made design of each kind, manual positions; printed on the real printer and the QR scanned)
- boxes and lines in a manual label (frames, rules) printed on the real printer
- rotated texts (90, 180, 270) in a manual design and a whole automatic design turned by 90, printed on the real printer
- small labels: the QR code left out when it does not fit, and the note and the advice of the tool match what prints
- labels opened in Inkscape (SVG) and printed with
brother_qlor CUPS (PNG at the printer's dpi, PDF) - cable flag label (from the cable diameter): wrap part, two faces, dashed fold; put on a real cable, the flag folds and both faces read
- migration of the antenna and filter cards from the components, at the start of the program (on a real
assets.json) - a DUT and its version in the form of a measurement (return loss, antenna, filter, Bode, regulation, ripple, resistive efficiency), the card in the run header
- history of a DUT and the latest measurement on its label
- variant of a run (a table of name and value: a part changed, a fan on or off): kept with the results, shown in the comparison and in the history
- the variant asked at every start of an efficiency, regulation or ripple run with a DUT (the last one proposed, for that run only)
- efficiency run with a DUT, its version and a variant (editor boxes, card in the run header)
- Hex/Dec/Bin converter
- Instrument library manager (add an instrument to the library)
- Hardware benchmark (
benchmarks/bench_hardware.py) on the lab power supply - Interactive instrument shell (
scripts/instrument_shell.py) and dry run (scripts/dry_run_call.py)
- Layout on high-DPI and scaled displays (Windows and Linux)
- The five languages (it, en, fr, es, de) in every window
- Packages: Windows installer and zip,
.deb,.rpm, tar.gz, Arch - Application and self-test on a clean Windows machine
Things that are planned but not started. They are deliberately left for later, when the measurements work
and the software reaches a beta state. The detailed plan (in Italian) is in PLAN.md.
- Measurement report: an HTML report that can be saved as PDF, built from a template the user can edit (project, measurement, instruments, parameters, plots, results). For now the results are exported as CSV (and Touchstone for RF traces).
- Measurement templates: ready-made measurement files to choose from New measurement (line and load regulation, I-V curve...) for the measurements that are a variation of an existing module.
- DUT archive: the devices under test (antennas, filters, converters, generic), each with a code, a name
and versions, kept apart from the cables, attenuators and adapters of the registry. Designed in
PLAN.md(section 12). - More measurement modules: load transient, battery discharge. See the table in
PLAN.md. - Instruments without SCPI: the LiteVNA67 (text commands on a serial port) and the Analog Discovery 2/3 (driver system).
Warning
This software is provided for hobbyist and non-professional use only.
The authors and contributors of Open Lab Automation accept no responsibility for damage to persons, property, or equipment resulting from the use of this software. Use at your own risk. The software is provided "as is", without any express or implied warranty. It is not intended for professional, industrial, or safety-critical use.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
- Adding support for new instruments in
Instruments_LIB/instruments_lib.json - Improving translations in
frontend/lang/*.json - Testing instruments of the library on real hardware and reporting the results (
Instruments_LIB/TESTING.md) - Adding the call schema of new instrument categories in
Instruments_LIB/schema/ - Adding new measurement capabilities
- Documentation improvements
See the LICENSE file for details.
For bug reports and feature requests, please use the GitHub Issues page.
When reporting errors, please include the error code (e.g., [DL-001]) shown in the error message for faster troubleshooting.