- Changed tabledrive to new MARS driving

- Various fixes to make SLS magnet controller more stable
This commit is contained in:
koennecke
2007-06-22 11:45:19 +00:00
parent a3467cb4ef
commit 3cf163f7f2
2 changed files with 30 additions and 6 deletions

View File

@@ -139,6 +139,7 @@ static int communicateSLS(mkChannel *pSock, char msg[6], char reply[6])
if(!pSock)
return NOTCONNECTED;
memset(reply,0,6);
address = (int)msg[1];
iRet = NETWrite(pSock,msg,6);
if(iRet < 0)
@@ -924,11 +925,34 @@ static void slsdspCodeToText(int code, char *text, int textlen){
return DEVFAULT;
}
ival = (int)reply[5];
if(ival != 0){
return DEVFAULT;
} else {
if(ival == 0){
return DEVREDO;
}
}
/*
* OK, clearing the error did not work, I try to reinitialize the
* socket because this helps sometimes.
*/
NETClosePort(pMe->pSock);
pMe->pSock = NULL;
pMe->pSock = NETConnect(pMe->pHost,pMe->iPort);
if(!pMe->pSock)
{
return DEVFAULT;
}
sleep(1);
msg[0] = DSPREAD;
msg[1] = 0x29;
iRet = communicateSLS(pMe->pSock,msg,reply);
if(iRet < 0)
{
return DEVFAULT;
}
ival = (int)reply[5];
if(ival == 0){
return DEVREDO;
} else {
return DEVFAULT;
}
}
switch(iError)