From dbc993d17384a8eb034a16eaf849613e6ae33fb9 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 22 Oct 2024 16:30:00 +0200 Subject: [PATCH] ReachTargetVoltage: Fix initial response check We want to only act specially on the very first sweep. But as we reset the index, we will land in this branch on every sweep if the resistance is too small. Let's prefer comparing to the number of acquired sweeps instead. --- Packages/MIES/MIES_AnalysisFunctions.ipf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Packages/MIES/MIES_AnalysisFunctions.ipf b/Packages/MIES/MIES_AnalysisFunctions.ipf index 36de482f58..0bc64b2ef8 100644 --- a/Packages/MIES/MIES_AnalysisFunctions.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions.ipf @@ -1143,8 +1143,10 @@ Function ReachTargetVoltage(string device, STRUCT AnalysisFunction_V3 &s) continue endif + WAVE sweeps = AFH_GetSweepsFromSameSCI(numericalValues, s.sweepNo, i) + // check initial response - if(index == 0 && resistanceFitted[i] <= 20e6) + if(DimSize(sweeps, ROWS) == 1 && resistanceFitted[i] <= 20e6) amps = -100e-12 targetVoltagesIndex[i] = -1 else