APPENDIX B: EXTERNAL COMMUNICATIONS INTERFACE SPECIFICATION
LW250 PULSED Nd: YAG LASER
990-605 REV B: May, 1997
B-27
cprintf(" (time over)");
return NG;
}
}
if (ex != 1){
if (rs[n] == ACK) || (rs[n] == NAK) || (rs[n] == ‘0'))
return OK;
else
return NG;
}
bcc = rs[1];
for (m=2; m < n; m++)
bcc
^
= rs[m];
if (rs[n] I= bcc)
return NG;
return OK;
}
/* receive id
-
ack */
rx
-i
dack()
{
char n, bf[3], c;
cprintf(" wait ID ACK !!!");
for (n=0; n<3; ){
if (getsts()) {
c = getch();
if (c == CTLC)
exit(0);
}
if (getrssts()) { /* receive data check */
bf[n] = rsin();
++n;
}
}
if ((bf[0] == id[0]&&(bf[1] == id[1]&&(bf[2] -- ACK))
return OK;
return NG;
}
/* clear 256 byte on rs */
rs
-
cir()
{
int n;
for (n=0; n < 0xff; n++)