From f2f8646d7664b4378d5f69c843da5fc7fb3de9be Mon Sep 17 00:00:00 2001 From: Markus Kristensson Date: Mon, 2 Feb 2026 16:53:18 +0100 Subject: [PATCH 1/3] Parse SetAxisAutoResetError Parses SetAxisAutoResetError to allow configuring if an error should be automatically reset when an axis is enabled. --- devEcmcSup/com/ecmcCmdParser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devEcmcSup/com/ecmcCmdParser.c b/devEcmcSup/com/ecmcCmdParser.c index 443597e5..7647f2d5 100644 --- a/devEcmcSup/com/ecmcCmdParser.c +++ b/devEcmcSup/com/ecmcCmdParser.c @@ -2437,6 +2437,13 @@ static int handleCfgCommand(const char *myarg_1) { return setAxisModType(iValue, iValue2); } + /*int Cfg.SetAxisAutoResetError(int axis_no, int autoResetError);*/ + nvals = sscanf(myarg_1, "SetAxisAutoResetError(%d,%d)", &iValue, &iValue2); + + if (nvals == 2) { + return SetAxisAutoResetError(iValue, iValue2); + } + /*int Cfg.SetAxisDisableAtErrorReset(int axis_no, int disable);*/ nvals = sscanf(myarg_1, "SetAxisDisableAtErrorReset(%d,%d)", From bbf0984d664b7e6b22f467743e8886a65e540581 Mon Sep 17 00:00:00 2001 From: Markus Kristensson Date: Mon, 2 Feb 2026 16:55:26 +0100 Subject: [PATCH 2/3] Add setAxisAutoResetError() Adds a function to allow the parser to setup the configured bit. --- devEcmcSup/motion/ecmcMotion.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/devEcmcSup/motion/ecmcMotion.cpp b/devEcmcSup/motion/ecmcMotion.cpp index 3b4ef2f4..5dbcae97 100644 --- a/devEcmcSup/motion/ecmcMotion.cpp +++ b/devEcmcSup/motion/ecmcMotion.cpp @@ -3572,6 +3572,20 @@ int setAxisModType(int axisIndex, return axes[axisIndex]->setModType(type); } +int setAxisAutoResetError(int axisIndex, + int autoResetError) { + LOGINFO4("%s/%s:%d axisIndex=%d, autoResetError=%d \n", + __FILE__, + __FUNCTION__, + __LINE__, + axisIndex, + autoResetError); + +CHECK_AXIS_RETURN_IF_ERROR(axisIndex); + +return axes[axisIndex]->setAutoResetError(autoResetError); +} + int setAxisDisableAtErrorReset(int axisIndex, int disable) { LOGINFO4("%s/%s:%d axisIndex=%d, disable=%d \n", From b08e0a44ce32274643d7f2c23d3f657b0880fd38 Mon Sep 17 00:00:00 2001 From: Markus Kristensson Date: Mon, 2 Feb 2026 17:20:29 +0100 Subject: [PATCH 3/3] Control autoreset of error when enabled Creates: *A variable to control the autoreset of an error when axis enabled. *A function, setAutoResetError, to configure the variable. Controls the execution of errorReset() if autoreset is enabled. --- devEcmcSup/motion/ecmcAxisBase.cpp | 8 +++++++- devEcmcSup/motion/ecmcAxisBase.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/devEcmcSup/motion/ecmcAxisBase.cpp b/devEcmcSup/motion/ecmcAxisBase.cpp index 0f62682e..d3819e2f 100644 --- a/devEcmcSup/motion/ecmcAxisBase.cpp +++ b/devEcmcSup/motion/ecmcAxisBase.cpp @@ -309,6 +309,7 @@ void ecmcAxisBase::initVars() { enableAutoEnable_ = 0; enableAutoDisable_ = 0; positionTargetAsyn_ = 0; + enableAutoResetError_ = 0; } void ecmcAxisBase::preExecute(bool masterOK) { @@ -627,7 +628,7 @@ int ecmcAxisBase::getErrorID() { int ecmcAxisBase::setEnableLocal(bool enable) { if (enable && !data_.status_.statusWord_.enable) { - errorReset(); + if(enableAutoResetError_) errorReset(); extEncVeloFilter_->initFilter(0); // init to 0 vel extTrajVeloFilter_->initFilter(0); // init to 0 vel if( (!data_.status_.statusWord_.attarget) || (!firstEnableDone_) || (!mon_->getEnableAtTargetMon())) { @@ -1404,6 +1405,11 @@ int ecmcAxisBase::getModType() { return (int)data_.control_.moduloType; } +int ecmcAxisBase::setAutoResetError(bool enable) { + enableAutoResetError_ = enable; + return 0; +} + int ecmcAxisBase::getCntrlError(double *error) { *error = data_.status_.cntrlError; return 0; diff --git a/devEcmcSup/motion/ecmcAxisBase.h b/devEcmcSup/motion/ecmcAxisBase.h index c34ba996..224a6ded 100644 --- a/devEcmcSup/motion/ecmcAxisBase.h +++ b/devEcmcSup/motion/ecmcAxisBase.h @@ -316,6 +316,7 @@ class ecmcAxisBase : public ecmcError { bool enableAutoEnable_; bool enableAutoDisable_; double positionTargetAsyn_; + bool enableAutoResetError_; }; #endif /* ECMCAXISBASE_H_ */