I can't quite figure out what it's doing wrong but you have :- for(i=0;i wrote: > > Hi to all engineers, > > I got stock on small routine any help will appreciated. > all it suppose to do is ignore a few byte of 11 byte of array i have > and if none ignored bytes changes generate an error. > > any idea of what i am doing wrong? > > Andre > > > #define BUFFER_SIZE 11 > BYTE buffer[BUFFER_SIZE]; > BYTE next_in = 0; > BYTE next_out = 0; > > int c,i; > BYTE const target_data[BUFFER_SIZE]={0x42,0x00,0x00,0x00,0x04,0x01,0x01,0x01,0x01,0x01,0x05}; > byte read_data=~target_data[0]; > > > while(1) { > #use rs232(baud=57600,parity=N,rcv=PIN_C3,bits=8) // RS422 to RS232 > for(i=0;i { > if(i==0 && read_data == 0x42) continue; > if((i==2||i==3||i==5||i==6||i==7||i==8)) > { > read_data=getc(); > continue; > } > > > if((read_data = getc())!=target_data[i]) break; > } > if(i==BUFFER_SIZE) > { > data_ok(); > } > else data_bad(); > } > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist