beautypg.com

AMETEK SLM-4 User Manual

Page 65

background image

Sorensen SLM-4 Chassis

Appendix B

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;

ACE_INT_IDENT_REG = 0x3fa;

ACE_LINE_CTL_REG = 0x3fb;

ACE_MODEM_CTL_REG = 0x3fc;

ACE_LINE_STAT_REG = 0x3fd;

ACE_MODEM_STAT_REG = 0x3fe;

COM_INT_NUM = 12;

IRQ_MASK = 0xef;

/* IRQ mask for IRQ4 (11101111) */

}
bioscom(0, 0xe3, pd_com-1);

/* boud rate : 9600, 1 start bit */

pd_rem();

/* no parity, 1 stop bit. */

pd_wrt("remote",6);

/* data bit : 8 bits */

return(SUCCESS);
}

int pd_meas(char *wrtmbuf, char *rdmbuf,int wrtmcnt,int rdmcnt)
{
static char *wrtbuf[10] = { "CURR 1", "CURR 2", "CURR 3", "CURR 4",
"VOLT 1", "VOLT 2", "VOLT 3", "VOLT 4", }
char tmpbuf[20] ={"chan "};
int cnt,result,t,cmp,measerr;
char ch;
char rdtmpbuf[20],chanbuf[20];
char measbuf[6];
for (cnt = 0; cnt < wrtmcnt; cnt++, wrtmbuf++)
{
measbuf[cnt] = *wrtmbuf;

M540069-01 Rev B

B-5