Fix/falcon layout xml #313

Merged
menzel merged 2 commits from fix/falcon-layout-xml into main 2026-09-09 12:29:26 +02:00
Member

_initialize_detector_backend wrote a bare layout.xml into the HDF5 plugin. The IOC resolves that against its own working directory, where no such file exists — the cSAXS SITORO IOC ships it as cfg/layout.xml — so BEC overwrote a correct value with a broken one on every device init. The failure is silent: an unreadable layout doesn't raise, the plugin simply refuses to open the output file later with status=-1, the real cause buried in XMLErrorMsg_RBV. Now set to the path the IOC can resolve, and verified after writing.
The second commit is the prefix trap. The init took (*args, **kwargs), and the device server builds init kwargs by intersecting deviceConfig keys with the named parameters of the signature — so prefix was silently discarded and the Falcon was built with an empty one. Every signal then pointed at a bare suffix (HDF1:FilePath_RBV instead of X12SA-SITORO:HDF1:FilePath_RBV) and instantiation failed listing several hundred unreachable PVs. That reads exactly like a dead IOC, and was diagnosed as one for two hours while caget worked fine from the same host.
Merged into current main: 101 failed / 551 passed / 12 skipped, against a baseline of 101 failed / 532 passed.

_initialize_detector_backend wrote a bare layout.xml into the HDF5 plugin. The IOC resolves that against its own working directory, where no such file exists — the cSAXS SITORO IOC ships it as cfg/layout.xml — so BEC overwrote a correct value with a broken one on every device init. The failure is silent: an unreadable layout doesn't raise, the plugin simply refuses to open the output file later with status=-1, the real cause buried in XMLErrorMsg_RBV. Now set to the path the IOC can resolve, and verified after writing. The second commit is the prefix trap. The __init__ took (*args, **kwargs), and the device server builds init kwargs by intersecting deviceConfig keys with the named parameters of the signature — so prefix was silently discarded and the Falcon was built with an empty one. Every signal then pointed at a bare suffix (HDF1:FilePath_RBV instead of X12SA-SITORO:HDF1:FilePath_RBV) and instantiation failed listing several hundred unreachable PVs. That reads exactly like a dead IOC, and was diagnosed as one for two hours while caget worked fine from the same host. Merged into current main: 101 failed / 551 passed / 12 skipped, against a baseline of 101 failed / 532 passed.
menzel added 2 commits 2026-09-08 19:45:23 +02:00
_initialize_detector_backend put a bare "layout.xml" into the HDF5 plugin.
The IOC resolves that relative to its own working directory, where no such
file exists: the cSAXS SITORO IOC ships the layout as cfg/layout.xml
(installed at /ioc/X12SA-CPCL-FALCONX1/cfg/layout.xml), and that is what the
IOC configures at startup. BEC was overwriting a correct value with a broken
one on every device init.

The failure was silent and badly signposted. An unreadable layout does not
raise; the plugin simply refuses to open the output file later, reporting
"Error opening file ..., status=-1" with the actual cause buried in
XMLErrorMsg_RBV. Because a caget taken before a BEC device reload showed the
IOC's own valid value, the two readings disagreed and the layout looked
innocent.

The default is now cfg/layout.xml, overridable per deployment with an
xml_file_name key in deviceConfig ("" selects the plugin's built-in layout),
and on_connected reads XMLValid_RBV back and logs an error naming the file
and the IOC's message if the layout was rejected.

The existing on_connected test asserted the broken value; it now asserts the
default constant.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KLnmUurqcNd1FiDY5M2uZr
fix(falcon): name prefix in __init__ so the device server stops dropping it
CI for csaxs_bec / test (push) Successful in 1m45s
CI for csaxs_bec / test (pull_request) Successful in 1m51s
b20afd15ea
The __init__ added in the previous commit took (*args, **kwargs). The device
server builds a device's init kwargs by intersecting the deviceConfig keys
with the NAMED parameters of the class signature
(bec_server/device_server/devices/devicemanager.py:469-475), so 'prefix' was
silently discarded and the Falcon was constructed with an empty prefix.

Every signal then pointed at a bare suffix -- HDF1:FilePath_RBV instead of
X12SA-SITORO:HDF1:FilePath_RBV -- and instantiation failed with
"TimeoutError: Failed to connect to all signals" listing several hundred PVs.
That reads like an unreachable IOC, which is how it was diagnosed at the
beamline for two hours, while caget from the same host worked perfectly.

The signature now names name, prefix, scan_info, device_manager and
xml_file_name explicitly, matching DDG1. Two tests guard it: one asserts every
deviceConfig key is a named parameter, the other that a configured prefix
reaches the signal PV names.

Reported-by: Klaus Wakonig <klaus.wakonig@psi.ch>

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KLnmUurqcNd1FiDY5M2uZr
menzel merged commit af5603d9b8 into main 2026-09-09 12:29:26 +02:00
menzel deleted branch fix/falcon-layout-xml 2026-09-09 12:29:26 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bec/csaxs_bec#313