pmacV3 enable/disable axis

The default behaviour of the pmac controller is to enable the motor at startup. With the controller V3 we want that at IOC startup the axis to be off.
A database entry like

record(longout, "$(P)$(M):Enable") {
    field(DTYP, "asynInt32")
    field(OUT, "@asyn($(PORT),$(N),1) ENABLE_AXIS")
    field(PINI, "YES")
}

can be used to give access to enable/disable the axis.
This commit is contained in:
Michele Brambilla
2022-03-02 15:24:15 +01:00
committed by brambilla_m
parent edc71af235
commit c7fea08718
4 changed files with 40 additions and 2 deletions

View File

@ -168,6 +168,8 @@ asynStatus pmacAxis::getAxisInitialStatus(void)
// Enable the axis. After startup, the axis are disabled on the controller...
// Warning: Selene lift axis should not be automatically enabled
printf("/nautoEnable: %d\n\n", autoEnable);
if (autoEnable) {
sprintf(command, "M%2.2d14=1\n", axisNo_);
asynPrint(pC_->pasynUserSelf, ASYN_TRACE_ERROR, "Enable axis %d: %s",axisNo_,command);

View File

@ -143,7 +143,7 @@ class LiftAxis : public pmacAxis
class pmacV3Axis : public pmacAxis {
public:
pmacV3AxisAxis(pmacController *pController, int axisNo) : pmacAxis(pController,axisNo, false) {};
pmacV3Axis(pmacController *pController, int axisNo) : pmacAxis(pController,axisNo, false) {};
protected:

View File

@ -839,7 +839,7 @@ asynStatus pmacV3Controller::writeInt32(asynUser *pasynUser, epicsInt32 value) {
asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW,
"%s: Enable axis on controller %s, axis %d enable=%d\n",
functionName, portName, pAxis->axisNo_, value);
errlogPrintf("Enable axis %d: %d, command = %s\n", pAxis->axisNo_, value, command);
//errlogPrintf("Enable axis %d: %d, command = %s\n", pAxis->axisNo_, value, command);
}
// Execute the command.