From 08c85129f32b97edfea8844236ea430bef234c1f Mon Sep 17 00:00:00 2001 From: smathis Date: Thu, 24 Jul 2025 11:16:37 +0200 Subject: [PATCH] Updated sinqMotor to 1.3.0 --- sinqMotor | 2 +- src/turboPmacAxis.cpp | 32 ++++++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/sinqMotor b/sinqMotor index 55a9fe6..1910eda 160000 --- a/sinqMotor +++ b/sinqMotor @@ -1 +1 @@ -Subproject commit 55a9fe6f3e02162f71ba54aab2d753066073f5ac +Subproject commit 1910eda0b14e1a8143d7b82cb9d9529ec71dddf7 diff --git a/src/turboPmacAxis.cpp b/src/turboPmacAxis.cpp index 644e3ee..6dec21c 100644 --- a/src/turboPmacAxis.cpp +++ b/src/turboPmacAxis.cpp @@ -265,6 +265,11 @@ asynStatus turboPmacAxis::doPoll(bool *moving) { // Was the axis idle during the previous poll? int previousStatusDone = 1; + if (axisNo() == 1) { + asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, "START POLL: at %lli\n", + timeInMilliseconds()); + } + // ========================================================================= if (pTurboPmacA_->needInit) { @@ -378,6 +383,15 @@ asynStatus turboPmacAxis::doPoll(bool *moving) { // Store the axis status pTurboPmacA_->axisStatus = axStatus; + // if (axStatus == -3 || axStatus == -5) { + if (axisNo() == 1) { + asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, + "POLL: Axis status %i at %lli\n", axStatus, + timeInMilliseconds()); + } + + //} + // Update the enablement PV setAxisParamChecked(this, motorEnableRBV, (axStatus != -3 && axStatus != -5)); @@ -1115,6 +1129,9 @@ asynStatus turboPmacAxis::enable(bool on) { } } + asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, "Sending enable %i at %lli\n", + on, timeInMilliseconds()); + // Enable / disable the axis if it is not moving snprintf(command, sizeof(command), "M%2.2d14=%d", axisNo_, on); asynPrint(pC_->pasynUser(), ASYN_TRACE_FLOW, @@ -1134,7 +1151,7 @@ asynStatus turboPmacAxis::enable(bool on) { while (time(NULL) < startTime + timeout_enable_disable) { // Read the axis status - usleep(100000); + // usleep(100000); status = pC_->writeRead(axisNo_, command, response, 1); if (status != asynSuccess) { return status; @@ -1145,13 +1162,20 @@ asynStatus turboPmacAxis::enable(bool on) { __PRETTY_FUNCTION__, __LINE__); } + asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, + "Axis status %i at %lli\n", pTurboPmacA_->axisStatus, + timeInMilliseconds()); + if ((pTurboPmacA_->axisStatus != -3) == on) { bool moving = false; - // Perform a poll to update the parameter library - poll(&moving); + forcedPoll(&moving); + + int enabled = 0; + getAxisParamChecked(this, motorEnableRBV, &enabled); asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR, - "Finished enable %i at %lli\n", on, timeInMilliseconds()); + "Finished enable %i at %lli, value motorEnableRBV = %i\n", + on, timeInMilliseconds(), enabled); return asynSuccess; }