Skip to content

Commit

Permalink
Merge pull request #83 from mp49/autopower_fix
Browse files Browse the repository at this point in the history
Fix issue with power being left on when using autoPower option in asy…
  • Loading branch information
kmpeters authored Apr 27, 2018
2 parents beba85f + 8229bb7 commit f3d4e0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions motorApp/MotorSrc/asynMotorController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
if (function == motorMoveRel_) {
if (autoPower == 1) {
status = pAxis->setClosedLoop(true);
pAxis->setWasMovingFlag(1);
epicsThreadSleep(autoPowerOnDelay);
}
getDoubleParam(axis, motorVelBase_, &baseVelocity);
Expand All @@ -296,6 +297,7 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
} else if (function == motorMoveAbs_) {
if (autoPower == 1) {
status = pAxis->setClosedLoop(true);
pAxis->setWasMovingFlag(1);
epicsThreadSleep(autoPowerOnDelay);
}
getDoubleParam(axis, motorVelBase_, &baseVelocity);
Expand All @@ -312,6 +314,7 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
} else if (function == motorMoveVel_) {
if (autoPower == 1) {
status = pAxis->setClosedLoop(true);
pAxis->setWasMovingFlag(1);
epicsThreadSleep(autoPowerOnDelay);
}
getDoubleParam(axis, motorVelBase_, &baseVelocity);
Expand All @@ -328,6 +331,7 @@ asynStatus asynMotorController::writeFloat64(asynUser *pasynUser, epicsFloat64 v
} else if (function == motorHome_) {
if (autoPower == 1) {
status = pAxis->setClosedLoop(true);
pAxis->setWasMovingFlag(1);
epicsThreadSleep(autoPowerOnDelay);
}
getDoubleParam(axis, motorVelBase_, &baseVelocity);
Expand Down

0 comments on commit f3d4e0f

Please sign in to comment.