- Fix to various drivers due to changes in rs232controller
- hkl now searches psi in .5 steps - first point of fastscan is driven normally
This commit is contained in:
33
el734hp.c
33
el734hp.c
@ -105,20 +105,24 @@ static int transactEL734(prs232 self, void *send, int sendLen,
|
||||
message only at the second try. This is the logic below.
|
||||
*/
|
||||
status = transactRS232(self,send,sendLen,reply,replylen);
|
||||
if(status == 1){
|
||||
if(status >= 1){
|
||||
pReply = (char *)reply;
|
||||
if(strstr(pReply,"*ES") != NULL){
|
||||
if(availableRS232(self)){
|
||||
len = replylen;
|
||||
readRS232TillTerm(self,reply,&len);
|
||||
}
|
||||
return transactRS232(self,send,sendLen,reply,replylen);
|
||||
status = transactRS232(self,send,sendLen,reply,replylen);
|
||||
if(status >= 1){
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
return status;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
return 0; /* not reached */
|
||||
}
|
||||
/*-------------------------------------------------------------------
|
||||
If we get an empty reply when we expect some response data, then, maybe,
|
||||
@ -272,12 +276,26 @@ static int decodeMSR(pEL734Driv self, int msr){
|
||||
*/
|
||||
if(msr & 0x80){
|
||||
self->runCount++;
|
||||
}else if(msr & 0x20){
|
||||
self->errorCode = HILIM;
|
||||
return HWFault;
|
||||
}else if(msr & 0x10){
|
||||
self->errorCode = LOWLIM;
|
||||
return HWFault;
|
||||
}else if(msr & 0x1000){
|
||||
self->errorCode = BADCUSHION;
|
||||
return HWFault;
|
||||
}else if(msr & 0x40){
|
||||
self->errorCode = BADSTP;
|
||||
return HWFault;
|
||||
} else if(msr & 0x200) {
|
||||
self->posCount++;
|
||||
} else if(msr & 0x100) {
|
||||
self->posCount++;
|
||||
self->errorCode = POSFAULT;
|
||||
return HWFault;
|
||||
} else if(msr & 0x400) {
|
||||
self->posCount++;
|
||||
self->errorCode = POSFAULT;
|
||||
return HWFault;
|
||||
}
|
||||
|
||||
return HWBusy;
|
||||
@ -521,6 +539,11 @@ static int EL734SetPar(void *pData, SConnection *pCon,
|
||||
}
|
||||
self->fLower = newValue;
|
||||
snprintf(pCommand,79,"H %d %8.3f %8.3f\r",self->iMotor,self->fLower, self->fUpper);
|
||||
} else if(strcmp(name,"forcepos") == 0){
|
||||
if(!SCMatchRights(pCon,usMugger)){
|
||||
return 0;
|
||||
}
|
||||
snprintf(pCommand,79,"U %d %8.3f\r",self->iMotor,newValue);
|
||||
}
|
||||
if(strlen(pCommand) > 1){
|
||||
status = transactEL734(self->controller,pCommand,strlen(pCommand),
|
||||
|
Reference in New Issue
Block a user