Reading data at 10 Khz rate

newbee_2:
No first 24 bit will be CAAC1F(in HEX) if it is then receive next 96 bits otherwise slide to next bit until it matches the string but the string matching is done on a PC where LabVIEW software is running so my job is to silde it until i get send all 96 bits command from labview

And this code is somewhat working can you take a look at it.
...
And for your questions

  1. I need to send them as hex format for labview understanding
  2. No
  3. No
  4. HEX
  5. Keep on sending that Data till i receive a command from pc send next 96 bits of data that data also need to in HEX format fro labview understanding.
    Thanks in Advance
    Niladri

If I'm understanding you correctly, until you get a CAAC1F pattern match of the fixed pre-amble for the next frame/packet you won't know the bit boundary to start your 4-bit values on. Since that's the information you can use to synchronise your serial comms you will need to do the pattern matching on your Arduino rather than the PC or you'll not be guaranteed to be sending data that's aligned to the correct 4 bit boundaries. You can encode any arbitrary 4 bit pattern as hex and send it to the PC, but unless it's conforming to the correct 4-bit boundary your data will be meaningless.

If you know the CAAC1F pattern will be the preamble to every 128 bit data frame received, you can also use this as a mechanism to partially validate the most recent data received (ie once you've received 96 bits the next received data must be CAAC1F, or that previous data buffer is invalid).

Geoff