setup_measurement()#

Tektronix2SeriesMSO.setup_measurement(
measurement_type: ScopeMeasurementType,
channel: int,
) → None[source]#

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 where ADDNew "MEAS<n>" + MEAS<n>:TYPe creates a slot that briefly computes under the scope’s default type (typically Period) before the type change takes effect, causing the first measure() call to return a stale, wrong-type value. ADDMEAS doesn’t take a name; the new slot’s name (the scope auto-assigns the next MEAS<n>) is recovered by diffing MEASUrement: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.