From 690096a7a44d7953febdeec243320df44a77bee9 Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Thu, 6 Apr 2006 19:25:33 +0000 Subject: [PATCH] Fix from Peter for home command --- motorApp/MotorSrc/devMotorAsyn.c | 4 ++-- motorApp/MotorSrc/drvMotorAsyn.c | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/motorApp/MotorSrc/devMotorAsyn.c b/motorApp/MotorSrc/devMotorAsyn.c index f573adf7..e95ddfb3 100644 --- a/motorApp/MotorSrc/devMotorAsyn.c +++ b/motorApp/MotorSrc/devMotorAsyn.c @@ -239,11 +239,11 @@ static RTN_STATUS build_trans( motor_cmnd command, break; case HOME_FOR: pPvt->move_cmd = motorHome; - pPvt->param = *param; + pPvt->param = 1; break; case HOME_REV: pPvt->move_cmd = motorHome; - pPvt->param = -(*param); + pPvt->param = 0; break; default: need_call = 1; diff --git a/motorApp/MotorSrc/drvMotorAsyn.c b/motorApp/MotorSrc/drvMotorAsyn.c index 86e200d0..edd03879 100644 --- a/motorApp/MotorSrc/drvMotorAsyn.c +++ b/motorApp/MotorSrc/drvMotorAsyn.c @@ -299,7 +299,7 @@ static asynStatus readInt32(void *drvPvt, asynUser *pasynUser, return(asynError); } asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, - "drvMotorAsyn::readInt32, value=%d", *value); + "drvMotorAsyn::readInt32, value=%d\n", *value); return(asynSuccess); } @@ -337,7 +337,7 @@ static asynStatus readFloat64(void *drvPvt, asynUser *pasynUser, return(asynError); } asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, - "drvMotorAsyn::readFloat64, value=%f", *value); + "drvMotorAsyn::readFloat64, value=%f\n", *value); return(status); } @@ -367,6 +367,11 @@ static asynStatus writeInt32(void *drvPvt, asynUser *pasynUser, case motorStop: status = (*pPvt->drvset->stop)(pAxis->axis, pAxis->accel); break; + case motorHome: + status = (*pPvt->drvset->home)(pAxis->axis, pAxis->min_velocity, + pAxis->max_velocity, pAxis->accel, + (value == 0) ? 0 : 1); + break; case motorSetClosedLoop: status = (*pPvt->drvset->setInteger)(pAxis->axis, motorAxisClosedLoop, value); @@ -379,7 +384,7 @@ static asynStatus writeInt32(void *drvPvt, asynUser *pasynUser, break; } asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, - "drvMotorAsyn::writeInt32, value=%d", value); + "drvMotorAsyn::writeInt32, value=%d\n", value); return(status); } @@ -410,11 +415,12 @@ static asynStatus writeFloat64(void *drvPvt, asynUser *pasynUser, break; case motorMoveVel: status = (*pPvt->drvset->velocityMove)(pAxis->axis, pAxis->min_velocity, - abs(value), (value < 0) ? 0 : 1); + value, pAxis->accel); break; case motorHome: - status = (*pPvt->drvset->home)(pAxis->axis, pAxis->min_velocity, abs(value), pAxis->accel, - (value < 0) ? 0 : 1); + status = (*pPvt->drvset->home)(pAxis->axis, pAxis->min_velocity, + pAxis->max_velocity, pAxis->accel, + (value == 0) ? 0 : 1); break; case motorVelocity: pAxis->max_velocity = value; @@ -441,7 +447,8 @@ static asynStatus writeFloat64(void *drvPvt, asynUser *pasynUser, return(asynError); } asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, - "drvMotorAsyn::writeFloat64, reason=%s, value=%f", motorCommands[command].commandString, value); + "drvMotorAsyn::writeFloat64, reason=%d, value=%f\n", + command, value); return(status); }