# SCPI

Read and control SCPI bench instruments

- Category: Instruments
- Capabilities: Streams, Assets, Commands, Operations, Entities
- Runs on: Linux x64, Linux ARM64, macOS Apple silicon, macOS Intel, Windows x64

Read and control bench instruments that speak **SCPI**, over the network or a
serial port: power supplies, multimeters, electronic loads, oscilloscopes and
more. Add one input per instrument. Supported models are listed under
Supports.

## What you get

- **Live measurements** — for a power supply, each channel's measured
  voltage, current and output state.
- **Setpoints** — set voltage, set the current limit, and turn the output on
  or off from **Trellis** via `ch.write(path, value)`. Each command is read
  back, so you see commanded vs. measured.
- **Auto-detect** — leave **Model** on `auto` and the connector identifies the
  instrument. The channel list shows once connected.
- **Scope traces** — each oscilloscope channel's whole trace arrives as one
  reading on one channel, such as `/scope/scope1/ch1/waveform`, and draws as
  its own trace tile. Peak-to-peak arrives as a plain value on
  `/scope/scope1/ch1/vpp`.
- **One instrument per input**, named by its **Device name** (e.g. `psu1`).
  Channels read `/psu/psu1/…`.

## Setup

1. Put the instrument on the network and note its host and port. Power
   supplies often use port **5025**. Or plug it in over serial and note the
   port.
2. In **Inputs**, add **SCPI Instruments** and fill in:
   - **Device name** — a short label, e.g. `psu1`
   - **Connection (host:port or serial device)** — `192.168.1.50:5025`, or
     `/dev/ttyUSB0`. For serial, set **Serial baud rate**, **Serial parity**
     and **Command terminator** to match the instrument's menu.
   - **Model** — `auto`, or a specific model such as `rigol_dp800`
   - **Poll rate (Hz)** — how often to read, e.g. `10`
3. Press **Test connection**. It asks the instrument who it is (`*IDN?`) and
   shows the make, model and serial that answered.
4. Start the input. In the **Channels** table, give each channel a name and
   unit, such as `ch1/volt` → `bus voltage`, `V`.
5. Measured channels appear on **Live**. Setpoints (`voltage_sp`,
   `current_limit`, `output_sp`) are available in **Trellis**.

## Keysight 34980A

Scanned voltage channels stream with the instrument's own timestamps. Relays
and digital lines are commands. Fill in **Scan channels**, **Relay channels**
and **Digital inputs/outputs** with the instrument's slot-channel numbers:
`1001`, one bit as `5101/3`, a wider port as `6101:16`.

## Alicat and ESPEC

**Alicat** flow and pressure controllers and the **ESPEC GL** chamber are not
SCPI and cannot be auto-detected.

- Pick their **Model**: `alicat_mc`, `alicat_liquid`, `alicat_pressure` or
  `espec_gl`.
- Alicat serial settings (19200 baud, CR-terminated) are set for you.
- **Unit address** is the single-letter address set on the device (default
  `A`).

## Notes

- Setpoints are checked against the instrument's limits before they are sent.
  Every command is recorded.

## Supports

- Rigol DP800 series (DP811/DP813/DP821/DP831/DP832)
- Keysight/Agilent 34401A multimeter
- Keysight 34461A Truevolt multimeter
- Keithley 2750 Multimeter/Switch System (front-panel DMM)
- Keysight 34980A Multifunction Switch/Measure Unit
- Matrix WPS300S series (RS-232)
- Siglent SPD3303 series
- B&K Precision 9115
- Keysight E36100 series (E36102A/03A/04A/05A)
- TDK-Lambda Genesys series
- Keysight N5700 series (Genesys SCPI interface)
- B&K Precision 914x series (9140/9141)
- Keithley 2400 SourceMeter (measure side; source side planned)
- B&K Precision 85xxB electronic loads (8500B/8502B/8510B)
- Keysight InfiniiVision 1200 X-series oscilloscopes (DSOX1202/1204, EDUX1052)
- Siglent SDS1000X-E oscilloscopes
- Tektronix 2-Series MSO oscilloscopes (MSO22/MSO24)
- Rigol DG1000Z waveform generators (DG1022Z/DG1032Z/DG1062Z)
- Alicat MC-series mass-flow controllers (RS-232, model=alicat_mc)
- Alicat liquid-flow controllers (model=alicat_liquid)
- Alicat pressure controllers (model=alicat_pressure)
- ESPEC GL-series chamber controllers (model=espec_gl)

## Connection fields

| Field | Type | Required | Notes |
|---|---|---|---|
| Device name | Text | Yes |  |
| Connection (host:port or serial device) | Text | Yes |  |
| Serial baud rate | Number | No |  |
| Serial parity | Text | No |  |
| Command terminator | Text | No |  |
| Unit address (Alicat models only) | Text | No |  |
| Scan channels (34980A only) | Text | No |  |
| Scan range, volts full-scale (34980A only) | Number | No |  |
| Relay channels (34980A only) | Text | No |  |
| Digital inputs (34980A only) | Text | No |  |
| Digital outputs (34980A only) | Text | No |  |
| Model | Text | No |  |
| Poll rate (Hz) | Number | No |  |
