Vocabulary¶
String-compatible enums for token-valued parameters (coupling, trigger mode/slope/source/coupling/type, bandwidth limit, tracking mode) -- enums in, strings out
Public, string-compatible vocabulary for token-valued instrument parameters.
Every enum subclasses (str, Enum) with name == value, so members compare and hash equal to the plain canonical strings the API has always spoken: Coupling.DC == "DC". Setters accept either form; getters keep returning plain strings (spec: "enums in, strings out").
This module is deliberately leaf-level: it imports nothing from the driver or command-table modules, so those can import it without cycles. Which tokens a CONNECTED dialect supports is the command layer's knowledge (scpi_commands.py token maps); the enums here are the union vocabulary.
Coupling
¶
Bases: str, Enum
Channel coupling. Wire mapping is per-dialect (legacy speaks D1M/A1M).
TriggerType
¶
Bases: str, Enum
Public trigger-type vocabulary (MAUI-descended naming: SLEW = slope trigger, GLIT = pulse/glitch trigger).
normalize_token
¶
normalize_token(value: Union[str, Enum], *, parameter: str, valid: Iterable[str], aliases: Optional[Mapping[str, str]] = None, dialect: Optional[str] = None, model: Optional[str] = None) -> str
Uppercase, alias-fold, and validate a token; return the canonical string.
Raises InvalidParameterError (also a ValueError) carrying the parameter name, the offending value, and the valid options for THIS instrument.
Source code in scpi_control/vocabulary.py
See Also¶
- Oscilloscope - Main oscilloscope control class for SCPI communication
- Scope Capabilities - Derived, dialect-resolved capabilities of a connected oscilloscope (scope.capabilities)
- Channel - Channel configuration and control
- Trigger - Trigger configuration and modes