Added flag to disable reading the limits from the hardware
This commit is contained in:
@@ -609,19 +609,30 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
||||
__LINE__);
|
||||
}
|
||||
|
||||
pl_status = pC_->setDoubleParam(axisNo_, pC_->motorHighLimitFromDriver(),
|
||||
highLimit);
|
||||
int limFromHardware = 0;
|
||||
pl_status =
|
||||
pC_->getIntegerParam(axisNo_, pC_->limFromHardware(), &limFromHardware);
|
||||
if (pl_status != asynSuccess) {
|
||||
return pC_->paramLibAccessFailed(pl_status, "motorHighLimitFromDriver_",
|
||||
axisNo_, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
return pC_->paramLibAccessFailed(pl_status, "limFromHardware", axisNo_,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
pl_status =
|
||||
pC_->setDoubleParam(axisNo_, pC_->motorLowLimitFromDriver(), lowLimit);
|
||||
if (pl_status != asynSuccess) {
|
||||
return pC_->paramLibAccessFailed(pl_status, "motorLowLimit_", axisNo_,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
if (limFromHardware != 0) {
|
||||
pl_status = pC_->setDoubleParam(
|
||||
axisNo_, pC_->motorHighLimitFromDriver(), highLimit);
|
||||
if (pl_status != asynSuccess) {
|
||||
return pC_->paramLibAccessFailed(
|
||||
pl_status, "motorHighLimitFromDriver_", axisNo_,
|
||||
__PRETTY_FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
pl_status = pC_->setDoubleParam(axisNo_, pC_->motorLowLimitFromDriver(),
|
||||
lowLimit);
|
||||
if (pl_status != asynSuccess) {
|
||||
return pC_->paramLibAccessFailed(pl_status, "motorLowLimit_",
|
||||
axisNo_, __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
pl_status = setMotorPosition(currentPosition);
|
||||
|
||||
@@ -45,6 +45,7 @@ struct turboPmacControllerImpl {
|
||||
int rereadEncoderPosition;
|
||||
int readConfig;
|
||||
int flushHardware;
|
||||
int limFromHardware;
|
||||
};
|
||||
#define NUM_turboPmac_DRIVER_PARAMS 3
|
||||
|
||||
@@ -114,6 +115,17 @@ turboPmacController::turboPmacController(const char *portName,
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
status = createParam("LIM_FROM_HARDWARE", asynParamInt32,
|
||||
&pTurboPmacC_->limFromHardware);
|
||||
if (status != asynSuccess) {
|
||||
asynPrint(this->pasynUser(), ASYN_TRACE_ERROR,
|
||||
"Controller \"%s\" => %s, line %d\nFATAL ERROR (creating a "
|
||||
"parameter failed with %s).\nTerminating IOC",
|
||||
portName, __PRETTY_FUNCTION__, __LINE__,
|
||||
stringifyAsynStatus(status));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
Define the end-of-string of a message coming from the device to EPICS.
|
||||
It is not necessary to append a terminator to outgoing messages, since
|
||||
@@ -506,6 +518,9 @@ int turboPmacController::rereadEncoderPosition() {
|
||||
}
|
||||
int turboPmacController::readConfig() { return pTurboPmacC_->readConfig; }
|
||||
int turboPmacController::flushHardware() { return pTurboPmacC_->flushHardware; }
|
||||
int turboPmacController::limFromHardware() {
|
||||
return pTurboPmacC_->limFromHardware;
|
||||
}
|
||||
|
||||
asynUser *turboPmacController::pasynInt32SyncIOipPort() {
|
||||
return pTurboPmacC_->pasynInt32SyncIOipPort;
|
||||
|
||||
@@ -122,6 +122,7 @@ class turboPmacController : public sinqController {
|
||||
int rereadEncoderPosition();
|
||||
int readConfig();
|
||||
int flushHardware();
|
||||
int limFromHardware();
|
||||
|
||||
asynUser *pasynInt32SyncIOipPort();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user