Fixed endless loop when communication times out and added

diagnostics.
This commit is contained in:
2025-05-05 09:18:04 +02:00
parent 3b39d724db
commit 370aef212e
2 changed files with 39 additions and 7 deletions

View File

@@ -161,7 +161,15 @@ asynStatus turboPmacAxis::init() {
axisNo_, axisNo_, axisNo_, axisNo_, axisNo_);
status = pC_->writeRead(axisNo_, command, response, 6);
if (status != asynSuccess) {
return status;
asynPrint(
pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nCould not communicate "
"with controller during IOC initialization. Check if you used "
"\"pmacAsynIPPortConfigure\" instead of the standard "
"\"drvAsynIPPortConfigure\" function in the .cmd file in order to "
"create the port driver.\nTerminating IOC.\n",
pC_->portName, axisNo(), __PRETTY_FUNCTION__, __LINE__);
exit(-1);
}
nvals = sscanf(response, "%d %lf %lf %lf %lf %d", &axStatus, &motorPos,
&motorVmax, &motorVelocity, &motorAccel, &acoDelay);