beautypg.com

AMETEK SLD Series User Manual

Page 84

background image

Appendix B

Sorensen SLD-Series DC Load

B-6

M540075-01 Rev C

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;
}
strupr(measbuf);
cnt = 0;
do
{
measerr = strncmp(measbuf,wrtbuf[cnt],6);
cnt = cnt++;
}while((cnt != 10) && (measerr != 0));
if(measerr == 0)
{

result = SUCCESS;

if (strncmp(measbuf,"CURR", 4) == 0)
{
ch = measbuf[5];
switch(ch)
{
case '1':
pd_wrt("chan 1",6);
pd_wrt("meas:curr?",10);