Removed node reset from doReset and moved it into dedicated function
Some checks failed
Test And Build / Lint (push) Failing after 4s
Test And Build / Build (push) Successful in 7s

A "normal" error reset should not trigger a node reset. However, this
option is still available via a dedicated PV xx:NodeReset and a
corresponding function in masterMacsAxis.
This commit is contained in:
2025-08-12 15:47:39 +02:00
parent 6553b468c8
commit 23a911206a
5 changed files with 92 additions and 9 deletions

View File

@@ -14,6 +14,9 @@
struct masterMacsControllerImpl {
double comTimeout;
// Indices of additional ParamLib entries
int nodeReset;
};
/**
@@ -68,6 +71,20 @@ masterMacsController::masterMacsController(const char *portName,
.comTimeout = comTimeout,
});
// =========================================================================
// Create additional parameter library entries
status =
createParam("NODE_RESET", asynParamInt32, &pMasterMacsC_->nodeReset);
if (status != asynSuccess) {
asynPrint(this->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\" => %s, line %d\nFATAL ERROR (creating a "
"parameter failed with %s).\nTerminating IOC",
portName, __PRETTY_FUNCTION__, __LINE__,
stringifyAsynStatus(status));
exit(-1);
}
// =========================================================================
/*
@@ -120,6 +137,22 @@ masterMacsAxis *masterMacsController::getMasterMacsAxis(int axisNo) {
return dynamic_cast<masterMacsAxis *>(asynAxis);
}
asynStatus masterMacsController::writeInt32(asynUser *pasynUser,
epicsInt32 value) {
int function = pasynUser->reason;
// =====================================================================
masterMacsAxis *axis = getMasterMacsAxis(pasynUser);
// Handle custom PVs
if (function == nodeReset()) {
return axis->nodeReset();
} else {
return sinqController::writeInt32(pasynUser, value);
}
}
asynStatus masterMacsController::read(int axisNo, int tcpCmd, char *response,
double comTimeout) {
return writeRead(axisNo, tcpCmd, NULL, response);
@@ -459,6 +492,8 @@ asynStatus masterMacsController::readInt32(asynUser *pasynUser,
double masterMacsController::comTimeout() { return pMasterMacsC_->comTimeout; }
int masterMacsController::nodeReset() { return pMasterMacsC_->nodeReset; }
/***************************************************************************/
/** The following functions are C-wrappers, and can be called directly from
* iocsh */