From fedf94a377eb8c883264b5cacb9d04d0bce92b90 Mon Sep 17 00:00:00 2001 From: kmpeters Date: Wed, 12 Dec 2012 21:50:20 +0000 Subject: [PATCH] Modifed SMC hydra support to set deceleration before aborting a move. Also added EOS config to SMC example. --- iocBoot/iocWithAsyn/motor.cmd.SMChydra | 4 ++++ motorApp/MicosSrc/SMChydraDriver.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/iocBoot/iocWithAsyn/motor.cmd.SMChydra b/iocBoot/iocWithAsyn/motor.cmd.SMChydra index 90130ec2..2921b2d2 100644 --- a/iocBoot/iocWithAsyn/motor.cmd.SMChydra +++ b/iocBoot/iocWithAsyn/motor.cmd.SMChydra @@ -12,6 +12,10 @@ asynSetTraceMask("serial5", 0, 1) # Leave ascii selected so traces can be turned on with a single click asynSetTraceIOMask("serial5", 0, 1) +# Set end-of-string terminators +asynOctetSetInputEos("serial5",0,"\r\n") +asynOctetSetOutputEos("serial5",0,"\r\n") + dbLoadTemplate("motor.substitutions.SMChydra") # SMChydraCreateController( diff --git a/motorApp/MicosSrc/SMChydraDriver.cpp b/motorApp/MicosSrc/SMChydraDriver.cpp index dab3174b..c82f25ed 100644 --- a/motorApp/MicosSrc/SMChydraDriver.cpp +++ b/motorApp/MicosSrc/SMChydraDriver.cpp @@ -267,6 +267,10 @@ asynStatus SMChydraAxis::stop(double acceleration ) asynStatus status; //static const char *functionName = "SMChydraAxis::stop"; + // Set stop deceleration (will be overridden by accel if accel is higher) + sprintf(pC_->outString_, "%f %i ssd", (acceleration * axisRes_), (axisNo_ + 1)); + status = pC_->writeController(); + sprintf(pC_->outString_, "%i nabort", (axisNo_ + 1)); status = pC_->writeController(); return status;