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: boolMC_Power.Enable.
fbs: [Fb; 9]§homed: bool§error_id: u16The axis error; not 0 is ErrorStop.
pos: f64The 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
impl Axis
Sourcepub fn new(info: &AxisInfo, home: f64) -> Self
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.
pub fn state(&self) -> State
Sourcepub fn master(&self) -> Option<usize>
pub fn master(&self) -> Option<usize>
The axis this one follows as a slave, where its master is an axis.
Sourcepub fn set_text(&mut self, name: &str, value: String) -> bool
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.
pub fn moving(&self) -> bool
Sourcepub fn variables(
&self,
drives_on: bool,
actual: (f64, f64),
) -> Vec<(String, Variant, bool)>
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.
Sourcepub fn power(&mut self, on: bool)
pub fn power(&mut self, on: bool)
MC_Power.Enable. Switched off, a motion under way is aborted.
Sourcepub fn set_param(&mut self, name: &str, value: f64) -> bool
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.
Sourcepub fn execute(&mut self, k: usize, on: bool, setpoint: f64, busy: bool)
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).