pcdsdevices.signal.PytmcSignalRW
- class pcdsdevices.signal.PytmcSignalRW(prefix, io=None, **kwargs)
Read-write connection to a pytmc-generated EPICS record.
Methods
- describe()
Return the description as a dictionary
- 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
- get_setpoint(*, as_string=None, timeout=<object object>, connection_timeout=<object object>, use_monitor=None, form='time', **kwargs)
Get the setpoint value (if setpoint PV and readback PV differ)
- 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(value, *, timeout=<object object>, settle_time=None)
Set the value of the Signal and return a Status object.
If put completion is used for this EpicsSignal, the status object will complete once EPICS reports the put has completed.
Otherwise the readback will be polled until equal to the set point (as in
Signal.set
)- Parameters:
- Returns:
st (Status)
See also
Signal.set
- 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
andEpicsSignal
, which are both subclasses ofEpicsSignalBase
.but
>>> EpicsSignal.set_defaults(...)
will not apply to
EpicsSignalRO
.- Parameters:
auto_monitor (bool, optional) – If
True
, update cached value from EPICS CA monitor callbacks. IfFalse
, 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'
- SUB_SETPOINT = 'setpoint'
- SUB_SETPOINT_META = 'setpoint_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 to its associated hardware, and ready to use?
- connection_timeout
- enum_strs
List of strings if PV is an enum type
- high_limit
The high, inclusive control limit for the Signal
- hints
Field hints for plotting
- kind
- limits
The PV control limits (low, high), such that low <= value <= high
- low_limit
The low, inclusive control limit for the Signal
- metadata
A copy of the metadata dictionary associated with the signal
- metadata_keys
Metadata keys that will be passed along on value subscriptions
- precision
The precision of the read PV, as reported by EPICS
- put_complete
Use put completion when writing the value
- pvname
The readback PV name
- read_access
Can the signal be read?
- setpoint
The setpoint PV value
- setpoint_alarm_severity
Setpoint PV alarm severity
- setpoint_alarm_status
Setpoint PV status
- setpoint_pvname
The setpoint PV name
- setpoint_ts
Timestamp of setpoint PV, according to EPICS
- subscriptions: ClassVar[FrozenSet[str]] = frozenset({'meta', 'setpoint', 'setpoint_meta', 'value'})
- timeout
- timestamp
Timestamp of readback PV, according to EPICS
- tolerance
The tolerance of the write PV, as reported by EPICS
Can be overidden by the user at the EpicsSignal level.
- Returns:
tolerance (float or None)
Using the write PV’s precision – If precision == 0, tolerance will be None If precision > 0, calculated to be 10**(-precision)
- use_limits
Check value against limits prior to sending to EPICS
- value
The signal’s value
- write_access
Can the signal be written to?
- write_timeout