Skip to main content

IAxis

Comprehensive interface for controlling a single motion axis.

Namespace: ControlBee.Interfaces

Extends: IDeviceChannel

Properties​

NameTypeDescription
InitializeSequenceIInitializeSequenceThe initialization sequence for this axis.
ResolutionValuedoubleThe resolution (units per pulse) of this axis.

Initialization Methods​

Initialize​

Runs the full initialization sequence for this axis.

void Initialize();

BuiltinInitialize​

Runs the built-in initialization logic without a custom sequence.

void BuiltinInitialize();

OnBeforeInitialize​

Called before the initialization sequence begins.

void OnBeforeInitialize();

SetInitializeAction​

Sets a custom initialization action to be executed during initialization.

void SetInitializeAction(Action initializeAction);

Parameters:

  • initializeAction — The action to execute.

IsInitializing​

Checks whether the axis is currently initializing.

bool IsInitializing();

Returns: true if the axis is initializing.

IsInitialized​

Checks whether the axis has been initialized.

bool IsInitialized();

Returns: true if the axis is initialized.

Enable / Alarm Methods​

Enable​

Enables or disables the axis servo.

void Enable();
void Enable(bool value);

Parameters:

  • value — true to enable, false to disable.

Disable​

Disables the axis servo.

void Disable();

IsEnabled​

Checks whether the axis servo is enabled.

bool IsEnabled();

Returns: true if the servo is enabled.

IsAlarmed​

Checks whether the axis is in an alarm state.

bool IsAlarmed();

Returns: true if the axis is alarmed.

ClearAlarm​

Clears the alarm state of the axis.

void ClearAlarm();

Movement Methods​

Move​

Commands the axis to move to an absolute position.

void Move(double position);
void Move(double position, bool @override);

Parameters:

  • position — The target position.
  • @override — If true, overrides any in-progress move.

MoveAndWait​

Moves to a position and waits until the move is complete.

void MoveAndWait(double position, PositionType type = PositionType.CommandAndActual);

Parameters:

  • position — The target position.
  • type — The position type to check for completion.

RelativeMove​

Commands a relative move by the specified distance.

void RelativeMove(double distance);

Parameters:

  • distance — The distance to move.

RelativeMoveAndWait​

Commands a relative move and waits until complete.

void RelativeMoveAndWait(double distance);

VelocityMove​

Starts continuous velocity movement in the specified direction.

void VelocityMove(AxisDirection direction);
void VelocityMove(AxisDirection direction, bool @override);

Parameters:

  • direction — The direction of movement.
  • @override — If true, overrides any in-progress move.

Stop​

Decelerates and stops the axis.

void Stop();

EStop​

Emergency stops the axis immediately.

void EStop();

Abort​

Aborts the current operation.

void Abort();

Wait​

Waits until the current movement is complete.

void Wait(PositionType type = PositionType.CommandAndActual);

IsMoving​

Checks whether the axis is currently moving.

bool IsMoving(PositionType type = PositionType.CommandAndActual);

Returns: true if the axis is moving.

IsVelocityMoving​

Checks whether the axis is in velocity move mode.

bool IsVelocityMoving();

Returns: true if the axis is velocity-moving.

Prepared Move Methods​

PrepareMove​

Queues an absolute move to be executed later.

void PrepareMove(double position);

PrepareRelativeMove​

Queues a relative move to be executed later.

void PrepareRelativeMove(double distance);

ExecutePreparedMoves​

Executes all queued prepared moves.

void ExecutePreparedMoves();

ExecutePreparedMovesWhenCountIs​

Executes prepared moves when the queue reaches the specified count.

void ExecutePreparedMovesWhenCountIs(int count);

ClearPreparedMoves​

Clears all queued prepared moves.

void ClearPreparedMoves();

WaitUntilMoveQueueEmpty​

Waits until the move queue is empty.

void WaitUntilMoveQueueEmpty(int millisecondsTimeout = 10000);

Parameters:

  • millisecondsTimeout — Maximum wait time in milliseconds. Default is 10000.

GetPreparedMoveCount​

Returns the number of queued prepared moves.

int GetPreparedMoveCount();

Position Methods​

GetPosition​

Returns the current position of the axis.

double GetPosition(PositionType type = PositionType.Command);

Parameters:

  • type — The position type (command or actual).

Returns: The current position value.

SetPosition​

Sets the position counter to the specified value.

void SetPosition(double position, PositionType type = PositionType.CommandAndActual);

ClearPosition​

Clears (zeros) the position counter.

void ClearPosition(PositionType type = PositionType.CommandAndActual);

IsNear​

Checks whether the axis is within a range of the specified position.

bool IsNear(double position, double range);

Returns: true if within range.

WaitNear​

Waits until the axis is within range of the specified position.

bool WaitNear(double position, double range);

IsFar​

Checks whether the axis is beyond a range from the specified position.

bool IsFar(double position, double range);

WaitFar​

Waits until the axis is beyond range from the specified position.

bool WaitFar(double position, double range);

IsPosition​

Checks the position using a comparison type.

bool IsPosition(PositionComparisonType type, double position);

WaitForPosition​

Waits until the position matches the comparison criteria.

bool WaitForPosition(PositionComparisonType type, double position);

Speed Methods​

SetSpeed​

Sets the speed profile for subsequent moves.

void SetSpeed(IVariable speedProfileVariable);
void SetSpeed(SpeedProfile speedProfile);

GetJogSpeed​

Returns the jog speed profile for the specified level.

SpeedProfile GetJogSpeed(JogSpeedLevel jogSpeedLevel);

GetNormalSpeed​

Returns the normal operating speed profile.

SpeedProfile GetNormalSpeed();

GetInitSpeed​

Returns the initialization speed profile.

SpeedProfile GetInitSpeed();

GetInitPos​

Returns the initialization (home) position.

Position1D GetInitPos();

GetVelocity​

Returns the current velocity of the axis.

double GetVelocity(VelocityType type);

SetTorque​

Sets the torque value for the axis.

void SetTorque(double torque);

Sensor Methods​

GetSensorValue​

Reads the value of the specified sensor.

bool GetSensorValue(AxisSensorType type);

GetSensorValueOrTrue​

Reads the sensor value, returning true if the sensor is unavailable.

bool GetSensorValueOrTrue(AxisSensorType type);

GetSensorValueOrFalse​

Reads the sensor value, returning false if the sensor is unavailable.

bool GetSensorValueOrFalse(AxisSensorType type);

WaitSensor​

Waits until the specified sensor reaches the expected value.

void WaitSensor(AxisSensorType type, bool waitingValue, int millisecondsTimeout);

SearchZPhase​

Searches for the Z-phase (index) signal over the given distance.

void SearchZPhase(double distance);

Software Limit Methods​

SetSoftwareLimit​

Configures the software position limits.

void SetSoftwareLimit(bool enable, double negativeLimit, double positiveLimit);

GetUseSoftwareLimit​

Checks whether software limits are enabled.

bool GetUseSoftwareLimit();

GetPositiveSoftwareLimitPosition​

Returns the positive software limit position.

double GetPositiveSoftwareLimitPosition();

GetNegativeSoftwareLimitPosition​

Returns the negative software limit position.

double GetNegativeSoftwareLimitPosition();

Special Methods​

SpecialCommand​

Sends a special command with arbitrary data to the axis.

void SpecialCommand(Dictionary<string, object?> data);

Events​

InitializedChanged​

Raised when the initialization state of the axis changes.

event EventHandler<bool>? InitializedChanged;

See Also​