Bug #616

Wrong number of FADC250 samples, when sample count is odd

Added by Stephen Wood 3 months ago. Updated 3 months ago.

Status:ResolvedStart date:02/04/2021
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-Spent time:0.50 hour
Target version:1.7
Responsible:

Description

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;

History

#1 Updated by Ole Hansen 3 months 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?

#2 Updated by Ole Hansen 3 months 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.

Also available in: Atom PDF