From a02ab92c279e6eddd9def54a620f2d3945702b4e Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Thu, 31 Mar 2011 21:09:34 +0000 Subject: [PATCH] Implemented motorUpdateStatus in asynMotorController::writeInt32 --- motorApp/MotorSrc/asynMotorDriver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/motorApp/MotorSrc/asynMotorDriver.cpp b/motorApp/MotorSrc/asynMotorDriver.cpp index 93d40c92..b1357c43 100644 --- a/motorApp/MotorSrc/asynMotorDriver.cpp +++ b/motorApp/MotorSrc/asynMotorDriver.cpp @@ -82,6 +82,7 @@ asynMotorController::asynMotorController(const char *portName, int numAxes, int * Extracts the function and axis number from pasynUser. * Sets the value in the parameter library. * If the function is motorStop_ then it calls pAxis->stop(). + * If the function is motorUpdateStatus_ then it does a poll and forces a callback. * Calls any registered callbacks for this pasynUser->reason and address. * Motor drivers will reimplement this function if they support * controller-specific parameters on the asynInt32 interface. They should call this @@ -95,6 +96,7 @@ asynStatus asynMotorController::writeInt32(asynUser *pasynUser, epicsInt32 value asynStatus status=asynSuccess; asynMotorAxis *pAxis; double accel; + int moving; static const char *functionName = "asynMotorController::writeInt32"; pAxis = getAxis(pasynUser); @@ -109,8 +111,10 @@ asynStatus asynMotorController::writeInt32(asynUser *pasynUser, epicsInt32 value status = pAxis->stop(accel); } else if (function == motorUpdateStatus_) { - // We don't implement this yet. Is it needed? - //status = this->forceCallback)(pasynUser); + /* Do a poll, and then force a callback */ + poll(); + pAxis->poll(&moving); + pAxis->statusChanged_ = 1; } /* Do callbacks so higher layers see any changes */