Skip to main content

El3356

Struct El3356 

Source
pub struct El3356 {
    pub peak_load: f32,
    pub busy: bool,
    pub error: bool,
    pub error_message: String,
    pub configured_mv_v: Option<f32>,
    pub configured_full_scale_load: Option<f32>,
    pub configured_scale_factor: Option<f32>,
    /* private fields */
}
Expand description

Function block for the Beckhoff EL3356 strain-gauge terminal.

Fields§

§peak_load: f32

Largest absolute load seen since construction, last reset, or last tare.

§busy: bool

True while a configuration sequence is in progress.

§error: bool

True after an SDO operation failed. Clear with clear_error.

§error_message: String

Last error message, if any.

§configured_mv_v: Option<f32>

Last successfully written sensitivity (mV/V). None until a configure() has completed.

§configured_full_scale_load: Option<f32>

Last successfully written full-scale load. None until a configure() has completed.

§configured_scale_factor: Option<f32>

Last successfully written scale factor. None until a configure() has completed.

Implementations§

Source§

impl El3356

Source

pub fn new(device: &str) -> Self

Create a new EL3356 function block for the given EtherCAT device name.

device must match the name used in project.json’s ethercat device list (it’s the device field sent with every SDO request).

Source

pub fn tick(&mut self, view: &mut El3356View<'_>, client: &mut CommandClient)

Call every control cycle.

Performs three things, in order:

  1. Updates peak_load from *view.load.
  2. Releases the tare pulse after 100 ms.
  3. Progresses any in-flight SDO operation from configure.
Source

pub fn configure( &mut self, client: &mut CommandClient, full_scale_load: f32, sensitivity_mv_v: f32, scale_factor: f32, )

Begin an SDO configuration sequence: sensitivity (mV/V), full-scale load, and scale factor written to object 0x8000 subs 0x23, 0x24, and 0x27 respectively. Non-blocking — sets busy = true and returns immediately. Poll busy / error on subsequent ticks.

No-op (logs a warning) if the FB is already busy. Any existing error flag is cleared at the start of a new sequence.

Source

pub fn reset_peak(&mut self)

Reset peak_load to 0.0. Immediate; no IPC.

Source

pub fn tare(&mut self)

Pulse the tare bit high for 100 ms, and reset the peak.

The device-side bit (view.tare) is actually written by tick, so tick must be called every cycle. If tare is called while a previous pulse is still in progress, the 100 ms window restarts.

Source

pub fn clear_error(&mut self)

Clear the error flag and message.

Source

pub fn sdo_write( &mut self, client: &mut CommandClient, index: u16, sub_index: u8, value: Value, ) -> u32

Low-level SDO write pass-through. Does not interact with the FB’s busy/state fields — use for advanced operations (e.g. changing the filter mode at runtime) that don’t fit the configure pattern.

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, 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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V