fix missing return from ITC4_Config, change SerialError to getRS232Error, adjust Formatting
r2415 | dcl | 2008-04-14 08:37:57 +1000 (Mon, 14 Apr 2008) | 2 lines
This commit is contained in:
@@ -191,91 +191,91 @@
|
|||||||
char pCommand[10];
|
char pCommand[10];
|
||||||
pITC4 self;
|
pITC4 self;
|
||||||
|
|
||||||
self = *pData;
|
self = *pData;
|
||||||
|
|
||||||
/* 3 input channels see p52 */
|
/* 3 input channels see p52 */
|
||||||
/* BUG ALLOWS iControl=4 */
|
/* BUG ALLOWS iControl=4 */
|
||||||
if (iControl < 1 || iControl > 3) {
|
if (iControl < 1 || iControl > 3) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
/* switch to remote and unlocked operation pg48 */
|
/* switch to remote and unlocked operation pg48 */
|
||||||
sprintf(pCommand,"C3");
|
sprintf(pCommand,"C3");
|
||||||
iRet = transactRS232(self->controller, pCommand,strlen(pCommand), pReply,79);
|
iRet = transactRS232(self->controller, pCommand,strlen(pCommand), pReply,79);
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
if(pReply[0] == '?')
|
if(pReply[0] == '?')
|
||||||
{
|
{
|
||||||
strcpy(self->pAns,pReply);
|
strcpy(self->pAns,pReply);
|
||||||
return ITC4__BADCOM;
|
return ITC4__BADCOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set heater and gas flow controls to manual pg51 */
|
/* Set heater and gas flow controls to manual pg51 */
|
||||||
sprintf(pCommand,"A0");
|
sprintf(pCommand,"A0");
|
||||||
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
||||||
pReply,79);
|
pReply,79);
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
if(pReply[0] == '?')
|
if(pReply[0] == '?')
|
||||||
{
|
{
|
||||||
strcpy(self->pAns,pReply);
|
strcpy(self->pAns,pReply);
|
||||||
return ITC4__BADCOM;
|
return ITC4__BADCOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set heater sensor pg 52 */
|
/* Set heater sensor pg 52 */
|
||||||
sprintf(pCommand,"H%1.1d",iControl);
|
sprintf(pCommand,"H%1.1d",iControl);
|
||||||
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
||||||
pReply,79);
|
pReply,79);
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
return ITC4__BADCOM;
|
return ITC4__BADCOM;
|
||||||
} else if(pReply[0] == '?')
|
} else if(pReply[0] == '?')
|
||||||
{
|
{
|
||||||
strcpy(self->pAns,pReply);
|
strcpy(self->pAns,pReply);
|
||||||
return ITC4__BADCOM;
|
return ITC4__BADCOM;
|
||||||
} else {
|
} else {
|
||||||
self->iControl = iControl;
|
self->iControl = iControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display on control sensor on front panel pg51 */
|
/* Display on control sensor on front panel pg51 */
|
||||||
sprintf(pCommand,"F%1.1d",iControl);
|
sprintf(pCommand,"F%1.1d",iControl);
|
||||||
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
||||||
pReply,79);
|
pReply,79);
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
if(pReply[0] == '?')
|
if(pReply[0] == '?')
|
||||||
{
|
{
|
||||||
strcpy(self->pAns,pReply);
|
strcpy(self->pAns,pReply);
|
||||||
return ITC4__BADCOM;
|
return ITC4__BADCOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Heater Auto, Gas Manual pg51 */
|
/* Heater Auto, Gas Manual pg51 */
|
||||||
sprintf(pCommand,"A1");
|
sprintf(pCommand,"A1");
|
||||||
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
iRet = transactRS232(self->controller, pCommand,strlen(pCommand),
|
||||||
pReply,79);
|
pReply,79);
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
if(pReply[0] == '?')
|
if(pReply[0] == '?')
|
||||||
{
|
{
|
||||||
strcpy(self->pAns,pReply);
|
strcpy(self->pAns,pReply);
|
||||||
return ITC4__BADCOM;
|
return ITC4__BADCOM;
|
||||||
}
|
}
|
||||||
/* reset timeout */
|
/* reset timeout */
|
||||||
/*iRet = SerialConfig(&self->pData, 10);*/
|
/*iRet = SerialConfig(&self->pData, 10);*/
|
||||||
if(iRet != 1)
|
if(iRet != 1)
|
||||||
{
|
{
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
int ITC4_Send(pITC4 *pData, char *pCommand, char *pReply, int iLen)
|
int ITC4_Send(pITC4 *pData, char *pCommand, char *pReply, int iLen)
|
||||||
@@ -443,7 +443,7 @@
|
|||||||
strncpy(pError,"ITC4: Failed three times to write new set value to ITC4",iLen);
|
strncpy(pError,"ITC4: Failed three times to write new set value to ITC4",iLen);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SerialError(iCode, pError,iLen);
|
getRS232Error(iCode, pError,iLen);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user