Wrong number of FADC250 samples, when sample count is odd
In some mode 10 FADC250 data I am looking at, each set of samples starts with 0xAF, indicating 175 samples. This is followed by 88 sample pairs. The last pair is "0x2142000". Bit 13 is on, indicating that the second sample of the last sample pair is invalid, as it should be because there are supposed to be 175, not 176 samples. However, Fadc250Module seems not to catch this so it records 176 samples, with the last sample being zero.
It looks like the code tries to detect this condition, but the code doesn't look right.
"if((sample_1 + 2) fadc_data.win_width && invalid_2) break; // Skip last sample if flagged as invalid"
appears twice. It looks like sample_1 is supposed to be some kind of sample count. But sample_1 is a data value. It should look something like:
if((numberofsamplessofarfadc_data.win_width) && invalid_2) break;
Updated by Ole Hansen almost 3 years ago
Good find. I am actually working on FADC-related things right now (using FADC data in the detector classes) and so will be interested in testing things with FADC data shortly. If this doesn't get fixed by then, I'll keep an eye out for this issue in the debugger. Unfortunately, I don't know much about how this module is supposed to work in detail. The code looks quite messy.
Who is our current FADC expert? Who has documentation?