AMETEK SLM Series Rev B User Manual
Page 79

Appendix B
SLM-Series AC/DC Electronic Load
M540072-01 Rev B
B-3
strupr(tempbuf);
strupr(intbuf);
cnt = 0;
do
{
comerr = strncmp(tempbuf,combuf[cnt],t);
cnt = cnt++;
}while(( cnt != COMPTR) && (comerr != 0));
if ( comerr == 0)
{
result = SUCCESS;
for (cnt = 0;cnt < count+1;cnt++)
{ while(inportb(ACE_LINE_STAT_REG) & THRE == 0);
ch = intbuf[cnt];
delay(20);
outportb(ACE_DATA_REG, ch);
}
timeout = 0;
for (cnt = 0; cnt <= count;cnt++)
{
ch = intbuf[cnt];
if(ch == '?')
{
do
{
read_buf();
}while((rd_result == 0)&&(timeout == 0));
rd_result
=
0;
}
}
for (cnt = 0;cnt<= count;cnt++)
{
intbuf[cnt] = '';
tempbuf[cnt] = '';
}
return(result);
}
return(OPER_ERR);
}
int pd_rd(char *buf,int count)
{
char ch;
int cnt = 0;
do
{
ch = queue[cnt];
*buf = ch;
cnt = cnt++;
buf = buf++;
}while((ch != '\n') && (cnt != count));
*buf = '\0';