Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions devEcmcSup/com/ecmcCmdParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
8 changes: 7 additions & 1 deletion devEcmcSup/motion/ecmcAxisBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ void ecmcAxisBase::initVars() {
enableAutoEnable_ = 0;
enableAutoDisable_ = 0;
positionTargetAsyn_ = 0;
enableAutoResetError_ = 0;
}

void ecmcAxisBase::preExecute(bool masterOK) {
Expand Down Expand Up @@ -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())) {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions devEcmcSup/motion/ecmcAxisBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ class ecmcAxisBase : public ecmcError {
bool enableAutoEnable_;
bool enableAutoDisable_;
double positionTargetAsyn_;
bool enableAutoResetError_;
};

#endif /* ECMCAXISBASE_H_ */
14 changes: 14 additions & 0 deletions devEcmcSup/motion/ecmcMotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down