Skip to content

Commit 31f83fc

Browse files
committed
AFM_CallAnalysisFunctions: Distinguish between RTEs and Aborts in catch case
And also tone down the message do the user.
1 parent 0e7a4e6 commit 31f83fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Packages/MIES/MIES_AnalysisFunctionManagement.ipf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// @return Valid analysis function return types, zero otherwise, see also @ref AnalysisFunctionReturnTypes
1515
Function AFM_CallAnalysisFunctions(string device, variable eventType)
1616

17-
variable i, valid_f1, valid_f2, valid_f3, ret, DAC, sweepsInSet, hwIsSutter
17+
variable i, valid_f1, valid_f2, valid_f3, ret, DAC, sweepsInSet, hwIsSutter, err
1818
variable realDataLengthAD, realDataLengthDA, sweepNo, fifoPositionAD, fifoPositionDA, sampleIntDA, sampleIntAD
1919
string func, msg
2020
STRUCT AnalysisFunction_V3 s
@@ -170,8 +170,12 @@ Function AFM_CallAnalysisFunctions(string device, variable eventType)
170170
endif
171171
catch
172172
msg = GetRTErrMessage()
173-
ClearRTError()
174-
printf "The analysis function %s aborted with error \"%s\", this is dangerous and must *not* happen!\r", func, msg
173+
err = ClearRTError()
174+
if(err)
175+
printf "The analysis function %s aborted due to an runtime error (%d) \"%s\".\r", func, err, msg
176+
else
177+
printf "The analysis function %s aborted with V_AbortCode (%d).\r", func, V_AbortCode
178+
endif
175179

176180
NVAR errorCounter = $GetAnalysisFuncErrorCounter(device)
177181
errorCounter += 1

0 commit comments

Comments
 (0)