I am writing a code to do the data acquisition. A device continousely
sends 8 bytes(2 bytes each time) data to COM port every 9ms after
sending notice. Since 8 bytes data represent 4 different meaning values
(A, B, C, and D) and no more notice between every 8 bytes, how to
correctly interpret the data group is very important. Currently, my
code checks the number of available bytes in the reading buffer and
extract data when buffer has 8 bytes. However, when I test the code,
the values are not stable and in different order. I think this is
because the data are wrongly interpreted. Do you have any idea how to
solve this problem? I did not put any extra delay in the program and
did not use any figures.
Thank you