beautypg.com

AMETEK SLD Series User Manual

Page 82

background image

Appendix B

Sorensen SLD-Series DC Load

B-4

M540075-01 Rev C

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';
queue[0] = '\0';
if (timeout == 1)
{
return(TIME_OUT);
}
return(SUCCESS);
}
int read_buf()
{
char ch,ch1;
int temp_index;
unsigned long ticks;
float sec1,sec2;
rd_result = 0;
ticks = biostime(0,0);
sec1 = ticks/18.2;
do
{
ticks = biostime(0,0);

sec2 = ticks/18.2;

if((sec2 - sec1) >= 20.0)

/* delay about 1 Sec */

{

timeout = 1;

}
ch = inportb(ACE_INT_IDENT_REG);
ch &= 0x06;
switch(ch)
{
case 6:
inportb(ACE_DATA_REG);

/* read the data register to empty it */