From be825dd68871fcb05614eb0187d9385114203727 Mon Sep 17 00:00:00 2001 From: kpetersn Date: Fri, 23 Mar 2018 15:44:35 -0500 Subject: [PATCH] Modified the stop method to use array writes. --- motorApp/AMCISrc/ANF2Driver.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/motorApp/AMCISrc/ANF2Driver.cpp b/motorApp/AMCISrc/ANF2Driver.cpp index b5b30501..5ad64619 100644 --- a/motorApp/AMCISrc/ANF2Driver.cpp +++ b/motorApp/AMCISrc/ANF2Driver.cpp @@ -664,20 +664,21 @@ asynStatus ANF2Axis::moveVelocity(double minVelocity, double maxVelocity, double asynStatus ANF2Axis::stop(double acceleration) { asynStatus status; - int stop_bit; + epicsInt32 stopReg; //static const char *functionName = "ANF2Axis::stop"; printf("\n STOP \n\n"); - // do nothing (for testing) - //return asynSuccess; + // The stop commands ignore all 32-bit registers beyond the first - stop_bit = 0x0; - status = pC_->writeReg16(axisNo_, CMD_MSW, stop_bit, DEFAULT_CONTROLLER_TIMEOUT); + // Clear the command/configuration register + status = pasynInt32ArraySyncIO->write(pasynUserConfWrite_, zeroReg_, 1, DEFAULT_CONTROLLER_TIMEOUT); -// stop_bit = 0x10; Immediate stop - stop_bit = 0x4; // Hold move - status = pC_->writeReg16(axisNo_, CMD_MSW, stop_bit, DEFAULT_CONTROLLER_TIMEOUT); + //stopReg = 0x10 << 16; Immediate stop + stopReg = 0x4 << 16; // Hold move + + // + status = pasynInt32ArraySyncIO->write(pasynUserConfWrite_, &stopReg, 1, DEFAULT_CONTROLLER_TIMEOUT); return status; }