moved disconnect handling to sinqMotor

This commit is contained in:
2026-01-22 09:47:36 +01:00
parent 78810c3364
commit a6979d303b
2 changed files with 188 additions and 157 deletions
+3 -9
View File
@@ -206,7 +206,6 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
// Definition of local variables.
asynStatus status = asynSuccess;
asynStatus timeoutStatus = asynSuccess;
char drvMessageText[MAXBUF_] = {0};
char modResponse[MAXBUF_] = {0};
int motorStatusProblem = 0;
@@ -284,8 +283,7 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
getMsgPrintControl().getSuffix());
}
timeoutStatus = checkComTimeoutWatchdog(axisNo, drvMessageText,
sizeof(drvMessageText));
checkComTimeoutWatchdog(axisNo, drvMessageText, sizeof(drvMessageText));
int timeoutCounter = 0;
while (1) {
@@ -333,14 +331,10 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
axis->setNeedInit(true);
}
if (timeoutStatus == asynError) {
status = asynError;
}
// The message should only ever terminate due to reason 2
msgPrintControlKey terminateKey =
msgPrintControlKey(portName, axisNo, __PRETTY_FUNCTION__, __LINE__);
if (eomReason != 2) {
if (status == asynSuccess && eomReason != 2) {
status = asynError;
char reasonStringified[30] = {0};
@@ -391,7 +385,7 @@ asynStatus turboPmacController::writeRead(int axisNo, const char *command,
}
msgPrintControlKey numResponsesKey =
msgPrintControlKey(portName, axisNo, __PRETTY_FUNCTION__, __LINE__);
if (numExpectedResponses != numReceivedResponses) {
if (status == asynSuccess && numExpectedResponses != numReceivedResponses) {
adjustResponseForPrint(modResponse, response, MAXBUF_);
if (getMsgPrintControl().shouldBePrinted(numResponsesKey, true,