diff --git a/src/turboPmacAxis.cpp b/src/turboPmacAxis.cpp index 571cbb4..ef26e90 100644 --- a/src/turboPmacAxis.cpp +++ b/src/turboPmacAxis.cpp @@ -143,7 +143,6 @@ asynStatus turboPmacAxis::init() { // Offset time for the movement watchdog caused by the air cushions in // milliseconds. int acoDelay = 0.0; - int axStatus = 0; // The parameter library takes some time to be initialized. Therefore we // wait until the status is not asynParamUndefined anymore. @@ -177,8 +176,7 @@ asynStatus turboPmacAxis::init() { Ixx65. */ snprintf(command, sizeof(command), - "P%2.2d00 Q%2.2d10 Q%2.2d03 Q%2.2d04 Q%2.2d06 P%2.2d22 Q%2.2d00 " - "I%2.2d65", + "Q%2.2d10 Q%2.2d03 Q%2.2d04 Q%2.2d06 P%2.2d22 Q%2.2d00 I%2.2d65", axisNo_, axisNo_, axisNo_, axisNo_, axisNo_, axisNo_, axisNo_, axisNo_); status = pC_->writeRead(axisNo_, command, response, 8); @@ -193,9 +191,9 @@ asynStatus turboPmacAxis::init() { pC_->portName, axisNo(), __PRETTY_FUNCTION__, __LINE__); pTurboPmacA_->needInit = true; } - nvals = sscanf(response, "%d %lf %lf %lf %lf %d %lf %lf", &axStatus, - &motorPos, &motorVmax, &motorVelocity, &motorAccel, - &acoDelay, &counts_to_eu, &deadband_counts); + nvals = sscanf(response, "%lf %lf %lf %lf %d %lf %lf", &motorPos, + &motorVmax, &motorVelocity, &motorAccel, &acoDelay, + &counts_to_eu, &deadband_counts); // The acoDelay is given in milliseconds -> Convert to seconds, rounded up setOffsetMovTimeout(std::ceil(acoDelay / 1000.0)); @@ -555,11 +553,6 @@ asynStatus turboPmacAxis::doPoll(bool *moving) { errorStatus = handleError(error, userMessage, sizeof(userMessage)); - // Update the parameter library - if (error != 0) { - setAxisParamChecked(this, motorStatusProblem, true); - } - if (*moving == false) { setAxisParamChecked(this, motorMoveToHome, false); } diff --git a/src/turboPmacAxis.h b/src/turboPmacAxis.h index b5b540b..3f3a5d6 100644 --- a/src/turboPmacAxis.h +++ b/src/turboPmacAxis.h @@ -13,6 +13,10 @@ class HIDDEN turboPmacAxis : public sinqAxis { * * @param pController Pointer to the associated controller * @param axisNo Index of the axis + * @param initialize By setting this parameter to false, the + * initialization functions of the axes are not executed. This is e.g. + * necessary when this constructor is called from a children class + * constructor which performs its own initialization. */ turboPmacAxis(turboPmacController *pController, int axisNo, bool initialize = true); @@ -24,6 +28,18 @@ class HIDDEN turboPmacAxis : public sinqAxis { */ virtual ~turboPmacAxis(); + /** + * @brief Readout of some values from the controller at IOC startup + * + * The following steps are performed: + * - Read out the motor status, motor position, velocity and acceleration + * from the MCU and store this information in the parameter library. + * - Set the enable PV according to the initial status of the axis. + * + * @return asynStatus + */ + virtual asynStatus init(); + /** * @brief Implementation of the `stop` function from asynMotorAxis * @@ -70,18 +86,6 @@ class HIDDEN turboPmacAxis : public sinqAxis { double min_velocity, double max_velocity, double acceleration); - /** - * @brief Readout of some values from the controller at IOC startup - * - * The following steps are performed: - * - Read out the motor status, motor position, velocity and acceleration - * from the MCU and store this information in the parameter library. - * - Set the enable PV according to the initial status of the axis. - * - * @return asynStatus - */ - virtual asynStatus init(); - /** * @brief Implementation of the `doReset` function from sinqAxis. *