Skip to content

XRD: start the Perkin Elmer's Acquire on its readback - #15

Merged
Anthony Sligar (sligara7) merged 1 commit into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-acquire-start
Oct 26, 2026
Merged

Anthony Sligar (sligara7) merged 1 commit into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-acquire-start

Conversation

@sligara7

Copy link
Copy Markdown

ensure_cont_acq_exposure started Acquire with abs_set(wait=False). Acquire is a busy record: its put completes only when acquisition stops. After a restart (new exposure time):

  • if the readback lags, ContAcqDetector.prepare raises Driver must be acquiring in continuous mode;
  • otherwise prepare(wait=True) (in xrd_scan and xrd_jog) waits on the Acquire put, which is in the same group (None), and times out.

It now waits for the readback with set_and_wait_for_value(..., wait_for_set_completion=False), as hextools did in NSLS2/hextools#110 (44c475d) after #10 was ported from that PR's earlier head.

Verified: mock tests. Two new tests model Acquire as a busy record and were observed failing first, one for each failure above; 78 pass. Not run on the beamline.

ensure_cont_acq_exposure started the busy Acquire record with abs_set(wait=False). With the readback lagging, ContAcqDetector.prepare raised 'Driver must be acquiring in continuous mode'; with it prompt, prepare(wait=True) waited on the Acquire put (group None), which completes only when acquisition stops, and timed out. It now waits for the readback with set_and_wait_for_value(wait_for_set_completion=False), as hextools 44c475d does. Both new tests observed failing first.

Assisted-by: copilot:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 26, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused synchronization fix addresses both reported failures, with targeted regression coverage and no blocking issues identified.

No open issues 🎉

What changed in this PR

This PR updates XRD acquisition startup to wait for the Perkin Elmer detector’s Acquire readback rather than its busy-record put completion, addressing restart races and scan preparation timeouts.

Changes:

  • Uses readback-based synchronization without waiting for Acquire’s put to complete.
  • Adds regression tests modeling delayed readback and a pending Acquire put to cover both reported failures.
File Description
tests/​test_xrd.py Adds busy-record simulation and regression tests for acquisition startup and scans after restart.
src/​pdftools/​xrd.py Waits for the Acquire readback before continuing, without joining the pending put to a RunEngine status group.

Review effort: Balanced

@sligara7
Anthony Sligar (sligara7) merged commit f7f9514 into NSLS2:pdf-profile-conversion Oct 26, 2026
4 checks passed
@sligara7
Anthony Sligar (sligara7) deleted the pdf-conv-acquire-start branch October 26, 2026 16:43
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.

2 participants