Skip to content

Don't create blank frame when starting an acquisition and EraseOnStart is enabled - #87

Open
ericonr wants to merge 3 commits into
epics-modules:masterfrom
ericonr:erase-on-start-frame
Open

Don't create blank frame when starting an acquisition and EraseOnStart is enabled#87
ericonr wants to merge 3 commits into
epics-modules:masterfrom
ericonr:erase-on-start-frame

Conversation

@ericonr

@ericonr ericonr commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This PR is based on the formatting performed in #86

Fixes #53

@newville

Copy link
Copy Markdown
Contributor

@ericonr does this need a rebase from dbf8735?

ericonr added 3 commits July 16, 2026 13:01
this name more accurately reflects the function's purpose. it also
avoids encoding in the driver code knowledge about the existence of ROI
plugins connected to it.
while clearing API buffers and driver statistics can be reasonable to do
when starting an acquisition, also sending a blank frame is not. when
acquisition is started, clients like the HDF5 and ROI plugins are
already enabled, so they will process this blank frame, leading to user
confusion and data loss. for the HDF5 plugin, the resulting file will
have an initial frame with empty data, and, if it's configured without
knowledge of the empty frame, the last real frame will be discarded. for
ROI plugins, CA clients should be able to expect a number of monitor
events equal to the number of acquisitions, leading to similar issues.

the blank frame creation was added by 734caa0 (update code to better
match APS-update, but with trig_b / deadtime corrections, 2016-09-28).
EraseOnStart was enabled by default for deployments using the provided
startup snippets by 8354d65 (add dbpf for EraseOnStart to start as Yes,
2021-09-08).

fix this issue by adding a sendFrame parameter to erase() and
clearDriverAndPlugins(). This allows them to differentiate between being
called by someone writing to the Erase PV (where we want to send a blank
frame) and someone writing to the Acquire PV when EraseOnStart is
enabled (where we don't want a blank frame).
@ericonr
ericonr force-pushed the erase-on-start-frame branch from d6a8360 to 17ff1bf Compare July 16, 2026 16:01
@ericonr

ericonr commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Rebase done!

@newville

Copy link
Copy Markdown
Contributor

@ericonr this is still a pretty big set of changes. I would want to test it before merging, but the only xspress3 I have access to is in production into August.

It would be nice if QD could test this on multiple systems.

@ericonr

ericonr commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

It is my understanding that this doesn't touch anything for specific hardware, but I would appreciate further testing, for sure.

@TomQD-94 do you think you could test this?

@ericonr

ericonr commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@newville I split the changes into dedicated commits for each part. That might make it easier to review! https://github.com/epics-modules/xspress3/pull/87/commits

@newville

Copy link
Copy Markdown
Contributor

@ericonr Yes, thanks, I don't disagree with that. The changes look fine to me - I don't have any objections, but the changes to some of the signatures give me a little pause, that perhaps some unidentified corner of the code may need adjusting.

If someone else is willing to try this out and give it an OK, I'm fine with merging. I won't be able to do that myself for a few weeks.

I don't expect there to be problems and have no objections to the changes (in fact, great!! thanks for finding and fixing this annoying misfeature!!), just being cautious.

@ericonr

ericonr commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

I will ask for testes in the next AreaDetector collaboration meeting.

In the meantime, tagging @jwlodek and @dmgav as it might be of interest to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All-zero, phantom frame w/unqiue ID -1 seen by HDF plugin on acquire

2 participants