Skip to content

Commit

Permalink
ReachTargetVoltage: Prefer sweepNo from the structure
Browse files Browse the repository at this point in the history
Missed in 85d6c5b (ReachTargetVoltage: Convert to V3 analysis function, 2020-11-20).
  • Loading branch information
t-b committed Nov 18, 2024
1 parent 53cd54c commit 3f34356
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Packages/MIES/MIES_AnalysisFunctions.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ End
/// the next sweep if the measured resistance is smaller than 20MΩ
Function ReachTargetVoltage(string device, STRUCT AnalysisFunction_V3 &s)

variable sweepNo, index, i, targetV, prevActiveHS, prevSendToAllAmp
variable index, i, targetV, prevActiveHS, prevSendToAllAmp
variable amps, result
variable autoBiasCheck, holdingPotential, indexing
string msg, name, control
Expand Down Expand Up @@ -1106,8 +1106,6 @@ Function ReachTargetVoltage(string device, STRUCT AnalysisFunction_V3 &s)
WAVE/Z sweep = AFH_GetLastSweepWaveAcquired(device)
ASSERT(WaveExists(sweep), "Expected a sweep for evaluation")

sweepNo = ExtractSweepNumber(NameOfWave(sweep))

WAVE numericalValues = GetLBNumericalValues(device)
WAVE textualValues = GetLBTextualValues(device)

Expand All @@ -1122,7 +1120,7 @@ Function ReachTargetVoltage(string device, STRUCT AnalysisFunction_V3 &s)

FitResistance(device, s.headstage, showPlot = 1)

WAVE/Z resistanceFitted = GetLastSetting(numericalValues, sweepNo, LABNOTEBOOK_USER_PREFIX + LBN_RESISTANCE_FIT, UNKNOWN_MODE)
WAVE/Z resistanceFitted = GetLastSetting(numericalValues, s.sweepNo, LABNOTEBOOK_USER_PREFIX + LBN_RESISTANCE_FIT, UNKNOWN_MODE)
ASSERT(WaveExists(resistanceFitted), "Expected fitted resistance data")

for(i = 0; i < NUM_HEADSTAGES; i += 1)
Expand Down

0 comments on commit 3f34356

Please sign in to comment.