From 530118a87a1c386e1e91b25304f9462cb7ed1e67 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 abb2714075..6cb54df4ac 100644 --- a/Packages/MIES/MIES_AnalysisFunctions.ipf +++ b/Packages/MIES/MIES_AnalysisFunctions.ipf @@ -1202,8 +1202,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