bluesky / ophyd

hardware abstraction in Python with an emphasis on EPICS
https://blueskyproject.io/ophyd
BSD 3-Clause "New" or "Revised" License
51 stars 79 forks source link

Provided value of trigger_value is ignored #1218

Closed prjemian closed 1 month ago

prjemian commented 1 month ago

The docstring in the Device code says a Component maybe marked as the Signal to use from the .trigger() method by setting the Component's trigger_value kwarg.

When it comes time to actually use that signal, the provided value is ignored and a 1 is sent: https://github.com/bluesky/ophyd/blob/5df3f5694f5c4c0ac049f0e601512f220e85744b/ophyd/device.py#L1460

From https://github.com/aps-8id-dys/bluesky/issues/99

prjemian commented 1 month ago

We found this yesterday when applying an external trigger signal from our SoftGlue FPGA to an area detector. Both devices must be triggered simultaneously. The FPGA needs a trigger value of "1!".

All current ophyd uses of the trigger_value show 1 in every case. Must have been an assumption that has worked so far. With this new FPGA code, the assumption breaks.

Time to use the supplied value. This commit (for the APS XPCS instrument) implements the change locally.

prjemian commented 1 month ago

NOTE: In the case of the XPCS FPGA's trigger signal, the Component should also include string=True.

tacaswell commented 1 month ago

It looks like the bug is there from the first implementation in f5d5c46240cd1a2a13d1a00d5481a76ee4cb9337 from 2015 🤯