Skip to main content

EpidRecord

Struct EpidRecord 

Source
pub struct EpidRecord {
Show 49 fields pub val: f64, pub smsl: i16, pub stpl: String, pub inp: String, pub outl: String, pub trig: String, pub tval: f64, pub cval: f64, pub cvlp: f64, pub oval: f64, pub ovlp: f64, pub kp: f64, pub ki: f64, pub kd: f64, pub p: f64, pub pp: f64, pub i: f64, pub ip: f64, pub d: f64, pub dp: f64, pub err: f64, pub errp: f64, pub dt: f64, pub dtp: f64, pub mdt: f64, pub fmod: i16, pub fbon: i16, pub fbop: i16, pub odel: f64, pub prec: i16, pub egu: String, pub hopr: f64, pub lopr: f64, pub drvh: f64, pub drvl: f64, pub hihi: f64, pub lolo: f64, pub high: f64, pub low: f64, pub hhsv: i16, pub llsv: i16, pub hsv: i16, pub lsv: i16, pub hyst: f64, pub lalm: f64, pub adel: f64, pub mdel: f64, pub alst: f64, pub mlst: f64, /* private fields */
}
Expand description

Extended PID feedback control record.

Ported from EPICS std module epidRecord.c. Supports PID and Max/Min feedback modes with anti-windup, bumpless turn-on, output deadband, and hysteresis-based alarms.

Fields§

§val: f64

Setpoint (VAL)

§smsl: i16

Setpoint mode: 0=supervisory, 1=closed_loop (SMSL)

§stpl: String

Setpoint input link (STPL) — resolved by framework

§inp: String

Controlled value input link (INP) — resolved by framework

§outl: String

Output link (OUTL) — resolved by framework

§trig: String

Readback trigger link (TRIG)

§tval: f64

Trigger value (TVAL)

§cval: f64

Controlled value (CVAL), read-only

§cvlp: f64

Previous controlled value (CVLP), read-only

§oval: f64

Output value (OVAL), read-only

§ovlp: f64

Previous output value (OVLP), read-only

§kp: f64

Proportional gain (KP)

§ki: f64

Integral gain — repeats per second (KI)

§kd: f64

Derivative gain (KD)

§p: f64

Proportional component (P), read-only

§pp: f64

Previous P (PP), read-only

§i: f64

Integral component (I), writable for bumpless init

§ip: f64

Previous I (IP)

§d: f64

Derivative component (D), read-only

§dp: f64

Previous D (DP), read-only

§err: f64

Error = setpoint - controlled value (ERR), read-only

§errp: f64

Previous error (ERRP), read-only

§dt: f64

Delta time in seconds (DT), writable for fast mode

§dtp: f64

Previous delta time (DTP)

§mdt: f64

Minimum delta time between calculations (MDT)

§fmod: i16

Feedback mode: PID or MaxMin (FMOD)

§fbon: i16

Feedback on/off (FBON)

§fbop: i16

Previous feedback on/off (FBOP)

§odel: f64

Output deadband (ODEL)

§prec: i16

Display precision (PREC)

§egu: String

Engineering units (EGU)

§hopr: f64

High operating range (HOPR)

§lopr: f64

Low operating range (LOPR)

§drvh: f64

High drive limit (DRVH)

§drvl: f64

Low drive limit (DRVL)

§hihi: f64

Hihi deviation limit (HIHI)

§lolo: f64

Lolo deviation limit (LOLO)

§high: f64

High deviation limit (HIGH)

§low: f64

Low deviation limit (LOW)

§hhsv: i16

Hihi severity (HHSV)

§llsv: i16

Lolo severity (LLSV)

§hsv: i16

High severity (HSV)

§lsv: i16

Low severity (LSV)

§hyst: f64

Alarm deadband / hysteresis (HYST)

§lalm: f64

Last value alarmed (LALM), read-only

§adel: f64

Archive deadband (ADEL)

§mdel: f64

Monitor deadband (MDEL)

§alst: f64

Last value archived (ALST), read-only

§mlst: f64

Last value monitored (MLST), read-only

Implementations§

Source§

impl EpidRecord

Source

pub fn check_alarms(&mut self) -> Option<(u16, u16)>

Check alarms using hysteresis-based threshold comparison on VAL. Ported from epidRecord.c checkAlarms().

Source

pub fn update_monitors(&mut self)

Update monitor tracking fields. Returns list of fields that changed. Ported from epidRecord.c monitor().

Trait Implementations§

Source§

impl Default for EpidRecord

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Record for EpidRecord

Source§

fn record_type(&self) -> &'static str

Return the record type name (e.g., “ai”, “ao”, “bi”).
Source§

fn process(&mut self) -> CaResult<ProcessOutcome>

Process the record (scan/compute cycle). Read more
Source§

fn get_field(&self, name: &str) -> Option<EpicsValue>

Get a field value by name.
Source§

fn put_field(&mut self, name: &str, value: EpicsValue) -> CaResult<()>

Set a field value by name.
Source§

fn field_list(&self) -> &'static [FieldDesc]

Return the list of field descriptors.
Source§

fn as_any_mut(&mut self) -> Option<&mut dyn Any>

Downcast to concrete type for device support init injection. Override in record types that need device support to inject state (e.g., MotorRecord).
Source§

fn set_device_did_compute(&mut self, did_compute: bool)

Called by the framework before process() to indicate whether device support’s read() already performed the record’s compute step. Override in records that have a built-in compute (e.g., epid PID) to skip it when device support already ran it. Default: ignore.
Source§

fn put_field_internal(&mut self, name: &str, value: EpicsValue) -> CaResult<()>

Internal field write that bypasses read-only checks. Used by the framework to write values from ReadDbLink actions into fields that are normally read-only (e.g., epid.CVAL). Default implementation delegates to put_field().
Return multi-input link field pairs: (link_field, value_field). Override in calc, calcout, sel, sub to return INPA..INPL → A..L mappings.
Return multi-output link field pairs: (link_field, value_field). Override in transform to return OUTA..OUTP → A..P mappings.
Source§

fn took_metadata_change(&mut self) -> bool

Optional: report whether this record’s last process() call mutated a metadata-class field (EGU/PREC/HOPR/LOPR/HLM/LLM/ alarm limits / DRVH/DRVL / state strings). Read more
Source§

fn validate_put(&self, _field: &str, _value: &EpicsValue) -> Result<(), CaError>

Validate a put before it is applied. Return Err to reject.
Source§

fn on_put(&mut self, _field: &str)

Hook called after a successful put_field.
Source§

fn primary_field(&self) -> &'static str

Primary field name (default “VAL”). Override for waveform etc.
Source§

fn val(&self) -> Option<EpicsValue>

Get the primary value.
Source§

fn set_val(&mut self, value: EpicsValue) -> Result<(), CaError>

Set the primary value. Read more
Source§

fn can_device_write(&self) -> bool

Whether this record type supports device write (output records only).
Source§

fn is_put_complete(&self) -> bool

Whether async processing has completed and put_notify can respond. Records that return AsyncPendingNotify should return false while async work is in progress, and true when done. Default: true (synchronous records are always complete).
Whether this record should fire its forward link after processing.
Source§

fn should_output(&self) -> bool

Whether this record’s OUT link should be written after processing. Defaults to true. Override in calcout to implement OOPT conditional output.
Source§

fn uses_monitor_deadband(&self) -> bool

Whether this record uses MDEL/ADEL deadband for monitor posting. Binary records (bi, bo, busy, mbbi, mbbo) return false because C EPICS always posts monitors for these record types regardless of whether the value changed.
Source§

fn init_record(&mut self, _pass: u8) -> Result<(), CaError>

Initialize record (pass 0: field defaults; pass 1: dependent init).
Source§

fn special(&mut self, _field: &str, _after: bool) -> Result<(), CaError>

Called before/after a field put for side-effect processing.
Source§

fn clears_udf(&self) -> bool

Whether processing this record should clear UDF. Override to return false for record types that don’t produce a valid value every cycle.
Source§

fn pre_process_actions(&mut self) -> Vec<ProcessAction>

Return pre-process actions (ReadDbLink) that the framework should execute BEFORE calling process(). This is called once per cycle. Default returns empty. Override in records that need link reads to be available during process().

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more