uchar idata SlaveOutputBuf[MaxRegLen]; // Hight 8 bit of word is front,Low 8 bit is back
uchar idata SlaveInputBuf[MaxRegLen];
uchar data *port _at_ 0x7F ;
/* exp data define */
//#define SlaveAdr XBYTE [0xD800]
sbit LED0=P2^0;
sbit LED1=P2^1;
sbit LED2=P2^2;
sbit LED3=P2^3;
sbit LED4=P2^4;
sbit LED5=P2^5;
sbit LED6=P2^6;
sbit LED7=P2^7;
sbit LED8=P0^0;
sbit LED9=P0^1;
sbit LED10=P0^2;
sbit LED11=P0^3;
sbit LED12=P0^4;
sbit LED13=P0^5;
sbit LED14=P0^6;
sbit LED15=P0^7;
uchar idata ForceCoilBuf[10];
uchar count=0;
uchar forceval=0x00;
//bit forcesendF=0;
/* Table Of CRC Values for high-order byte */
uchar code auchCRCHi[] = {
0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81,
0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0,
0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01,
0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, |