Skip to main content

Axis

Struct Axis 

Source
pub struct Axis {
    pub enable: bool,
    pub fbs: [Fb; 9],
    pub homed: bool,
    pub error_id: u16,
    pub pos: f64,
    pub vel: f64,
    pub texts: [String; 3],
    pub own_cam: Option<(Cam, CamMaster)>,
    /* private fields */
}

Fields§

§enable: bool

MC_Power.Enable.

§fbs: [Fb; 9]§homed: bool§error_id: u16

The axis error; not 0 is ErrorStop.

§pos: f64

The setpoint streamed to the controller, and its speed.

§vel: f64§texts: [String; 3]

The text inputs of TEXTS, in their order.

§own_cam: Option<(Cam, CamMaster)>

The machine’s own electronic cam with this axis its slave (Machine::cam): the table over one master period, and its master’s speed and run-up. MC_CamIn takes it with CamTableID 1.

Implementations§

Source§

impl Axis

Source

pub fn new(info: &AxisInfo, home: f64) -> Self

An axis standing at home, the position MC_Home moves to. The numeric inputs start at the axis limits.

Source

pub fn state(&self) -> State

Source

pub fn master(&self) -> Option<usize>

The axis this one follows as a slave, where its master is an axis.

Source

pub fn set_text(&mut self, name: &str, value: String) -> bool

A text input by its name after the block’s (GearIn.Master, CamIn.Master, CamIn.Table), taken on the block’s rising edge. False for no such input.

Source

pub fn moving(&self) -> bool

Source

pub fn variables( &self, drives_on: bool, actual: (f64, f64), ) -> Vec<(String, Variant, bool)>

The axis’s variables as (name, value, writable), always in the same order. drives_on says whether the controller’s drives are on, actual is the simulated axis’s position and velocity.

Source

pub fn fault(&mut self, error: u16)

An axis error: ErrorStop until MC_Reset.

Source

pub fn power(&mut self, on: bool)

MC_Power.Enable. Switched off, a motion under way is aborted.

Source

pub fn set_param(&mut self, name: &str, value: f64) -> bool

A numeric input, by its name after the function block’s (MoveAbsolute.Position). False for no such input.

Source

pub fn execute(&mut self, k: usize, on: bool, setpoint: f64, busy: bool)

Execute of function block k written. A rising edge starts it with the inputs it has then; setpoint is where the controller’s setpoint stands, busy whether the controller runs a move, path or cycle of the link’s other commands. A falling edge clears the outputs of a block that has finished; one still busy runs on and keeps its outputs until the next rising edge. A block of synchronised motion has no master here (execute_in gives it one).

Source

pub fn advance(&mut self, t: f64, setpoint: f64)

One setpoint interval t of the profile. Without a motion the axis follows setpoint, where the controller’s setpoint stands, so that the link’s other commands and other axes’ moves do not leave it behind.

Trait Implementations§

Source§

impl Clone for Axis

Source§

fn clone(&self) -> Axis

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Axis

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Axis

§

impl RefUnwindSafe for Axis

§

impl Send for Axis

§

impl Sync for Axis

§

impl Unpin for Axis

§

impl UnsafeUnpin for Axis

§

impl UnwindSafe for Axis

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> IntoAnyArc for T
where T: Send + Sync + 'static,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Upcast to Arc<dyn Any>.
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
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