snoplus / tellie

The timing ELLIE LED calibration system
0 stars 11 forks source link

Bugfix when reading the pins and the PIC chip is still writing. #45

Closed Mark--S closed 6 years ago

Mark--S commented 6 years ago

Sometimes when we try to make a PIN reading the PIC chip hasn't finished writing to the buffer, so we only get part of the PIN reading. This bugfix makes the server wait for 0.1 seconds if it doesn't get a complete PIN reading. After the wait the code reads out the buffer again appending it to whatever we already had.

Mark--S commented 6 years ago

This needs testing underground before merge.

mnirkko commented 6 years ago

Can confirm code seems to work, no more warnings occurred over approx. 2M events. (Previously was about 1 in 10^5 events.)

Mark--S commented 6 years ago

Okay I think Ive made all the changes.

EdLeming commented 6 years ago

Cool, looks good to me. Lemme know when it's been tested and I'll merge

mnirkko commented 6 years ago

So the only change seems to be an extra delay, and slightly different output. I can probably run TELLIE locally, but not via ORCA as the timing rack is currently off (we are working on the laser trigger system today). Would you be ok with that?

EdLeming commented 6 years ago

yeah, that's fine 👍

mnirkko commented 6 years ago

Seems to work ok. Can run in Master mode at maximal pulse number for different channels (upper and lower boxes). Also found an annoying bug related to the pulse number, which I just created PR #46 for.

mnirkko commented 6 years ago

So the other PR #46 appears to be a red herring. The fixes in this PR are fine, and I haven't got any of the above warnings from running locally. Please merge.