Bug #616


Wrong number of FADC250 samples, when sample count is odd

Added by Stephen Wood over 3 years ago. Updated over 1 year ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Spent time:


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;

Actions #1

Updated by Ole Hansen over 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?

Actions #2

Updated by Ole Hansen about 3 years ago

  • Status changed from New to Resolved
  • Target version set to 1.7
  • % Done changed from 0 to 100

Fixed in commit e803fc4. The fix might be preliminary. If the problem persists, we can reopen this.

Actions #3

Updated by Ole Hansen over 1 year ago

  • Status changed from Resolved to Closed

Closing this old issue since I haven't heard any further complaints in over a year.


Also available in: Atom PDF