apsbits.utils.controls_setup#

Module Attributes

oregistry

Registry of all ophyd-style Devices and Signals.

Functions

connect_scan_id_pv(RE[, pv])

Define a PV to use for the RunEngine's scan_id.

epics_scan_id_source(_md)

Callback function for RunEngine.

set_control_layer([control_layer])

Communications library between ophyd and EPICS Channel Access.

set_timeouts(timeouts)

Set default timeout for all EpicsSignal connections & communications.

apsbits.utils.controls_setup.connect_scan_id_pv(RE, pv: str | None = None)[source]#

Define a PV to use for the RunEngine’s scan_id.

apsbits.utils.controls_setup.epics_scan_id_source(_md)[source]#

Callback function for RunEngine. Returns next scan_id to be used.

  • Ignore metadata dictionary passed as argument.

  • Get current scan_id from PV.

  • Apply lower limit of zero.

  • Increment (so that scan_id numbering starts from 1).

  • Set PV with new value.

  • Return new value.

Exception will be raised if PV is not connected when next bps.open_run() is called.

apsbits.utils.controls_setup.oregistry#

Registry of all ophyd-style Devices and Signals.

apsbits.utils.controls_setup.set_control_layer(control_layer: str = 'PyEpics')[source]#

Communications library between ophyd and EPICS Channel Access.

Choices are: PyEpics (default) or caproto.

OPHYD_CONTROL_LAYER is an application of “lessons learned.”

Only used in a couple rare cases where PyEpics code was failing. It’s defined here since it was difficult to find how to do this in the ophyd documentation.

apsbits.utils.controls_setup.set_timeouts(timeouts)[source]#

Set default timeout for all EpicsSignal connections & communications.