beautypg.com

AMETEK SLD Series User Manual

Page 83

background image

Sorensen SLD-Series DC Load

Appendix B

M540075-01 Rev C

B-5

break;
case 0:
break;
case 2:
break;
case 4:

/* read character from data register */

ch1 = inportb(ACE_DATA_REG);
temp_index = input_index + 1;

/* increment index of input buffer*/

if (ch1 != '\n')

/* check terminate bit */

{
queue[input_index] = ch1; /* store character to input buffer*/
input_index = temp_index;
}
else
{
queue[input_index] = ch1;
input_index = temp_index;
input_index = 0;

/* if terminate bit was detected */

temp_index = 0;
rd_result = 1;

/* clear index and set return value */

}
break;
}

/* finally send the non-spacific */

}while ((rd_result == 0) && (timeout == 0));
}

int pd_init(int pd_com)
{
if ((pd_com != 1) && (pd_com != 2))
return(OPER_ERR);
if (pd_com == 2)

/* initial communication port 2 */

{

ACE_DATA_REG = 0x2f8;

ACE_INT_ENB_REG = 0x2f9;

ACE_INT_IDENT_REG = 0x2fa;

ACE_LINE_CTL_REG = 0x2fb;

ACE_MODEM_CTL_REG = 0x2fc;

ACE_LINE_STAT_REG = 0x2fd;

ACE_MODEM_STAT_REG = 0x2fe;

COM_INT_NUM = 11;

IRQ_MASK = 0xf7;

/* IRQ mask for IRQ3 (11110111) */

}
else

/* initial communication port 1 */

{

ACE_DATA_REG = 0x3f8;

ACE_INT_ENB_REG = 0x3f9;