setup_measurement()#
- Tektronix2SeriesMSO.setup_measurement(
- measurement_type: ScopeMeasurementType,
- channel: int,
Ensure a persistent measurement slot exists for this type and channel.
Uses
MEASUrement:ADDMEAS <type>to create the slot atomically with the target type — this avoids the race whereADDNew "MEAS<n>"+MEAS<n>:TYPecreates a slot that briefly computes under the scope’s default type (typically Period) before the type change takes effect, causing the firstmeasure()call to return a stale, wrong-type value.ADDMEASdoesn’t take a name; the new slot’s name (the scope auto-assigns the nextMEAS<n>) is recovered by diffingMEASUrement:LIST?before and after the add.Tektronix computes measurements during acquisition, so the slot must exist before the scope triggers for results to be valid.