- Reduced poll rate of EL737

- Removed unneeded hardware limit reading code from EL734
This commit is contained in:
2023-02-16 14:29:05 +01:00
parent 9b9072b83b
commit 3c9932dc18
2 changed files with 17 additions and 1 deletions

View File

@ -231,6 +231,7 @@ EL734Axis::EL734Axis(EL734Controller *pC, int axisNo)
if(count >= 2){ if(count >= 2){
pC_->setDoubleParam(axisNo_,pC_->motorLowLimit_,low); pC_->setDoubleParam(axisNo_,pC_->motorLowLimit_,low);
pC_->setDoubleParam(axisNo_,pC_->motorHighLimit_,high); pC_->setDoubleParam(axisNo_,pC_->motorHighLimit_,high);
callParamCallbacks();
} else { } else {
errlogPrintf("Bad response - %s - requesting limits at axis %d", reply, axisNo_); errlogPrintf("Bad response - %s - requesting limits at axis %d", reply, axisNo_);
} }
@ -267,6 +268,8 @@ asynStatus EL734Axis::move(double position, int relative, double minVelocity, do
// status = sendAccelAndVelocity(acceleration, maxVelocity); // status = sendAccelAndVelocity(acceleration, maxVelocity);
errlogPrintf("minVelocity = %f, maxVelocity = %f\n", minVelocity, maxVelocity);
if (relative) { if (relative) {
position += this->position; position += this->position;
} }
@ -377,6 +380,7 @@ asynStatus EL734Axis::setClosedLoop(bool closedLoop)
asynStatus EL734Axis::poll(bool *moving) asynStatus EL734Axis::poll(bool *moving)
{ {
int msr, count; int msr, count;
float low, high;
asynStatus comStatus = asynSuccess; asynStatus comStatus = asynSuccess;
char command[COMLEN], reply[COMLEN], errTxt[256]; char command[COMLEN], reply[COMLEN], errTxt[256];
@ -386,6 +390,18 @@ asynStatus EL734Axis::poll(bool *moving)
return asynSuccess; return asynSuccess;
} }
// read hardware limits
sprintf(command,"H %d",axisNo_);
comStatus = pC_->transactController(axisNo_,command,reply);
if(comStatus == asynSuccess){
count = sscanf(reply,"%f %f",&low, &high);
if(count >= 2){
pC_->setDoubleParam(axisNo_,pC_->motorLowLimit_,low);
pC_->setDoubleParam(axisNo_,pC_->motorHighLimit_,high);
callParamCallbacks();
}
}
// Read the current motor position // Read the current motor position
setIntegerParam(pC_->motorStatusProblem_,false); setIntegerParam(pC_->motorStatusProblem_,false);
sprintf(command,"u %d", axisNo_); sprintf(command,"u %d", axisNo_);

View File

@ -566,7 +566,7 @@ static void el737Thread(void *param)
*/ */
runEvents(priv); runEvents(priv);
if(priv->counting == 1){ if(priv->counting == 1){
timeout = .1; timeout = .2;
} }
} else { } else {
/* /*