pcdsdevices.signal.EpicsSignalROEditMD

class pcdsdevices.signal.EpicsSignalROEditMD(read_pv, *, string=False, name=None, **kwargs)

EpicsSignal variant which allows for user correction of various metadata.

Parameters:
  • enum_strings (list of str, optional) – List of enum strings to replace the EPICS originals. May not be used in conjunction with the dynamic enum_attrs.

  • enum_attrs (list of str, optional) – List of signal attribute names, relative to the parent device. That is to say a given attribute is assumed to be a sibling of this signal instance. Attribute names may be None in the case where the original enum string should be passed through.

See also

None, A, one, Keyword

Parameters:
  • read_pv (str) – The PV to read from

  • limits (bool, optional) – Check limits prior to writing value

  • auto_monitor (bool, optional) – Use automonitor with epics.PV

  • name (str, optional) – Name of signal. If not given defaults to read_pv

  • timeout (float or None, optional) –

    The timeout for serving a read request on a connected channel. This is only applied if the PV is connected within connection_timeout (below).

    The default value DEFAULT_TIMEOUT means, “Fall back to class-wide default.” See EpicsSignalBase.set_defaults to configure class defaults.

    Explicitly passing None means, “Wait forever.”

  • write_timeout (float or None, optional) –

    The timeout for a reply when put completion is used. This is only applied if the PV is connected within connection_timeout (below).

    This is very different than the connection and read timeouts above. It relates to how long an action takes to complete, such motor motion or data acquisition. Any default value we choose here is likely to cause problems—either by being too short and giving up too early on a lengthy action or being too long and delaying the report of a failure. A finite value can be injected here or, perhaps more usefully, via set at the Device level, where a context-appropriate value can be chosen.

  • connection_timeout (float or None, optional) –

    Timeout for connection. This includes the time to search and establish a channel.

    The default value DEFAULT_CONNECTION_TIMEOUT means, “Fall back to class-wide default.” See EpicsSignalBase.set_defaults to configure class defaults.

    Explicitly passing None means, “Wait forever.”

Methods

describe()

Return the signal description as a dictionary.

Units, limits, precision, and enum strings may be overridden.

Returns:

dict – Dictionary of name and formatted description string

get(*, as_string=None, timeout=<object object>, connection_timeout=<object object>, form='time', use_monitor=None, **kwargs)

Get the readback value through an explicit call to EPICS.

Parameters:
  • count (int, optional) – Explicitly limit count for array data

  • as_string (bool, optional) – Get a string representation of the value, defaults to as_string from this signal, optional

  • as_numpy (bool) – Use numpy array as the return type for array data.

  • timeout (float, optional) – maximum time to wait for value to be received. (default = 0.5 + log10(count) seconds)

  • use_monitor (bool, optional) – to use value from latest monitor callback or to make an explicit CA call for the value. (default: True)

  • connection_timeout (float, optional) – If not already connected, allow up to connection_timeout seconds for the connection to complete.

  • form ({'time', 'ctrl'}) – PV form to request

read()

Put the status of the signal into a simple dictionary format for data acquisition

Returns:

dict

read_configuration()

Dictionary mapping names to value dicts with keys: value, timestamp

set(*args, **kwargs)

Disabled for a read-only signal

classmethod set_default_timeout(**kwargs)
classmethod set_defaults(*, timeout=2.0, connection_timeout=1.0, write_timeout=None, auto_monitor=False)

Set class-wide defaults for EPICS CA communications

This may be called only before any instances of EpicsSignalBase are made.

This setting applies to the class it is called on and all its subclasses. For example,

>>> EpicsSignalBase.set_defaults(...)

will apply to EpicsSignalRO and EpicsSignal, which are both subclasses of EpicsSignalBase.

but

>>> EpicsSignal.set_defaults(...)

will not apply to EpicsSignalRO.

Parameters:
  • auto_monitor (bool, optional) – If True, update cached value from EPICS CA monitor callbacks. If False, request new value from EPICS each time get() is called.

  • connection_timeout (float, optional) – Time (seconds) allocated for establishing a connection with the IOC.

  • timeout (float, optional) – Total time budget (seconds) for reading, not including connection time.

  • write_timeout (float, optional) – Time (seconds) allocated for writing, not including connection time. The write_timeout is very different than the connection and read timeouts above. It relates to how long an action takes to complete. Any default value we choose here is likely to cause problems—either by being too short and giving up too early on a lengthy action or being too long and delaying the report of a failure. The default, None, waits forever.

Raises:

RuntimeError – If called after EpicsSignalBase has been instantiated for the first time.

trigger()

Call that is used by bluesky prior to read()

Attributes

SUB_META = 'meta'
alarm_severity

PV alarm severity

alarm_status

PV status

as_string

Attempt to cast the EPICS PV value to a string by default

connected

Is the signal connected and ready to use?

connection_timeout
enum_attrs

Enum attribute names - the source of each enum string.

enum_strs

List of enum strings.

For an EpicsSignalEditMD, this could be one of:

  1. The original enum strings from the PV

  2. The strings found from the respective signals referenced by

    enum_attrs.

  3. The user-provided strings in enum_strs.

high_limit

The high, inclusive control limit for the Signal

hints

Field hints for plotting

kind
limits

The PV limits as reported by EPICS (or EpicsSignalEditMD).

low_limit

The low, inclusive control limit for the Signal

metadata
metadata_keys

Metadata keys that will be passed along on value subscriptions

precision

The PV precision as reported by EPICS (or EpicsSignalEditMD).

pvname

The readback PV name

read_access

Can the signal be read?

subscriptions: ClassVar[FrozenSet[str]] = frozenset({'meta', 'value'})
timeout
timestamp

Timestamp of readback PV, according to EPICS

tolerance

The absolute tolerance associated with the value.

value

The signal’s value

write_access

Can the signal be written to?

write_timeout