Reading binary files, unflatten binary string
The binary file looks like this:
B004 2020 2701 2020 2020 2020 2080 A643 2801 2020 2020 2020 2080 A643
2901 2020 2020 2020 2080 A643 2A01 2020 2020 2020 2080 A643 2B01 2020
2020 2020 2080 A643 2C01 2020 2020 2020 2080 A643 2D01 2020 2020 2020
2080 A643 2E01 2020 2020 2020 2080 A643 2F01 2020 2020 2020 2080 A643
3001 2020 2020 2020 2080 A643 3101 2020 2020 2020 2080 A643 3201 2020
2020 2020 2080 A643 3301 2020 2020 2020 2080 A643 3401 2020 2020 2020
2080 A643 3501 2020 2020 2020 2080 A643 3601 2020 2020 2020 2080 A643
3701 2020 2020 2020 2080 A643 3801 2020 2020 2020 2080 A643 3901 2020
Etc..
The section 2020202020202080A643 is repeated throughout the file, all
or parts of it is probably a delimiter. 20202020202020 equals 7 space
characters.so that is very likely a delimiter.
Now the numbers between the delimiter is:
2801
2901
2A01
2B01
2C01
etc
From the text file we saw that the log contains a scan number, a
number that increments by 1 for each new line
If the byte order is LSB first then the numbers above equals:
0128h = 296d
0129h = 297d
012Ah = 298d
etc.so this is probably the scan number.
In the text report the recorded value is constantly 333.
Perhaps this is the A643 part of the repeating string? If it has the
least significant bit first as well then the recorded value equals
43A6h = 17318. Could that be correct, or should the answer be 333 just
like in the text file?
It might be easier to decode the file if it contains samples of
different values.