Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4COM)  1.26.2
IMovement Interface Reference

Inherits IDispatch.

Collaboration diagram for IMovement:
Collaboration graph

Public Member Functions

HRESULT Home (void)
 
HRESULT SetAbsoluteMeasurement (void)
 
HRESULT Power (VARIANT_BOOL value)
 
HRESULT MoveVelocity ([in] DOUBLE velocity, [in] DOUBLE acceleration, [in] DOUBLE deceleration, [in] DOUBLE jerk)
 
HRESULT MoveAbsolute ([in] DOUBLE position, [in] DOUBLE velocity, [in] DOUBLE acceleration, [in] DOUBLE deceleration, [in] DOUBLE jerk)
 
HRESULT MoveRelative ([in] DOUBLE distance, [in] DOUBLE velocity, [in] DOUBLE acceleration, [in] DOUBLE deceleration, [in] DOUBLE jerk)
 
HRESULT MoveAdditive ([in] DOUBLE distance, [in] DOUBLE velocity, [in] DOUBLE acceleration, [in] DOUBLE deceleration, [in] DOUBLE jerk)
 
HRESULT Stop ([in] VARIANT_BOOL stop, [in] DOUBLE deceleration, [in] DOUBLE jerk)
 
HRESULT GearIn ([in] AxisRef *masterAxis, [in] LONG numerator, [in] LONG denominator, [in] DOUBLE fineadjust)
 
HRESULT GearInPos ([in] AxisRef *masterAxis, [in] LONG numerator, [in] LONG denominator, [in] DOUBLE fineadjust, [in] StartMode startMode, [in] SyncDirection syncMode)
 
HRESULT FlexProfile ([in] AxisRef *masterAxis, [in] LONG numerator, [in] LONG denominator, [in] DOUBLE fineadjust, [in] LONG setSelection, [in] VARIANT_BOOL useSwitchingPos, [in] DOUBLE switchingPosition, [in] ProfileStartPoint profileEntry, [in] DOUBLE masterOffset, [in] DOUBLE slaveOffset, [in] SyncType syncMode, [in] DOUBLE syncVelocity, [in] DOUBLE syncAcceleration, [in] ProfileExecutionMode executionMode)
 
HRESULT Status ([out, retval] struct MotionStatus *motionStatus)
 
HRESULT Wait (VARIANT timeoutValue)
 
HRESULT PhasingSlave ([in] DOUBLE phaseShift, [in] DOUBLE velocity, [in] DOUBLE acceleration, [in] DOUBLE deceleration)
 
HRESULT Phasing ([in] DOUBLE phaseShift, [in] DOUBLE velocity, [in] DOUBLE acceleration, [in] DOUBLE deceleration)
 
HRESULT TorqueControl ([in] DOUBLE torque, [in] DOUBLE torqueRamp)
 
HRESULT CamIn ([in] AxisRef *masterAxis, [in] LONG numerator, [in] LONG denominator, [in] DOUBLE fineadjust, [in] DOUBLE camShaftDistance, [in] SyncDirection syncMode, [in] StartMode startMode, [in] CamTableId camId)
 
HRESULT SynchronOut ()
 
HRESULT OpenCyclicPositionChannel ()
 
HRESULT OpenCyclicVelocityChannel ()
 
HRESULT OpenCyclicAnalogChannel ()
 
HRESULT OpenCyclicTorqueChannel ()
 
HRESULT WriteCyclicPosition ([in] DOUBLE cyclicValue)
 
HRESULT WriteCyclicVelocity ([in] DOUBLE cyclicValue)
 
HRESULT WriteCyclicAnalog ([in] DOUBLE cyclicValue)
 
HRESULT WriteCyclicTorque ([in] DOUBLE cyclicValue)
 

Detailed Description

Definition of the IMovement interface used to access motion commands to move an axis or drive.

Use the IMovement interface to physically move or control an axis by using various motion commands.

Definition at line 71 of file IMovement.idl.

Member Function Documentation

HRESULT IMovement::Home ( void  )

This function serves to home an axis. Only an axis with incremental encoders can be homed. If the axis has an absolute encoder, the command "set absolute measurement" must be used.

Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// set current position as absolute position 0�
connection.Motion.Axes[axisNr].Movement.Home();
// wait with timeout until homing is finished
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionHome, where you can find further documentation.
HRESULT IMovement::SetAbsoluteMeasurement ( void  )

This function serves to "set absolute measurement" of an axis. Only axes with absolute encoders can be used with this function.

Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// set current position as absolute position 0�
connection.Motion.Axes[axisNr].Movement.SetAbsoluteMeasurement();
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionSetAbsoluteMeasurement, where you can find further documentation.
HRESULT IMovement::Power ( VARIANT_BOOL  value)

This function commands power to the drive.

Parameters
[in]valueBoolean value whether to activate or to deactivate power.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// switch axis to power
connection.Motion.Axes[axisNr].Movement.Power(true);
// wait with timeout till axis has power and is ready to move
connection.Motion.Axes[axisNr].Movement.Wait(1000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionPower, where you can find further documentation.
HRESULT IMovement::MoveVelocity ( [in] DOUBLE  velocity,
[in] DOUBLE  acceleration,
[in] DOUBLE  deceleration,
[in] DOUBLE  jerk 
)

This function commands a single axis movement of a single axis.

Parameters
[in]velocityVelocity in drives unit.
[in]accelerationAcceleration in drives unit.
[in]decelerationDeceleration in drives unit.
[in]jerkJerk in drives unit.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// move with constant velocity
connection.Motion.Axes[axisNr].Movement.MoveVelocity(100, 10, 10, 0);
// wait with timeout till axis reached target velocity
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionMoveVeloctiy, where you can find further documentation.
HRESULT IMovement::MoveAbsolute ( [in] DOUBLE  position,
[in] DOUBLE  velocity,
[in] DOUBLE  acceleration,
[in] DOUBLE  deceleration,
[in] DOUBLE  jerk 
)

This function defines an absolute position movement of a single axis.

Parameters
[in]positionPosition in drives unit.
[in]velocityVelocity in drives unit.
[in]accelerationAcceleration in drives unit.
[in]decelerationDeceleration in drives unit.
[in]jerkJerk in drives unit.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// move with constant velocity
connection.Motion.Axes[axisNr].Movement.MoveAbsolute(90, 10, 10, 10, 0);
// wait with timeout till axis reached target position
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionMoveAbsolute, where you can find further documentation.
HRESULT IMovement::MoveRelative ( [in] DOUBLE  distance,
[in] DOUBLE  velocity,
[in] DOUBLE  acceleration,
[in] DOUBLE  deceleration,
[in] DOUBLE  jerk 
)

This function commands a relative movement. The relative position is added to the current position and is used as new target. The difference to an additive movement is that the offset position is added to the current position, not the target position. So a currently running movement command is interrupted and only the offset position is added to the current position.

Parameters
[in]distanceDistance in drives unit.
[in]velocityVelocity in drives unit.
[in]accelerationAcceleration in drives unit.
[in]decelerationDeceleration in drives unit.
[in]jerkJerk in drives unit.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// move with constant velocity
connection.Motion.Axes[axisNr].Movement.MoveRelative(90, 10, 10, 10, 0);
// wait with timeout till axis reached distance
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionMoveRelative, where you can find further documentation.
HRESULT IMovement::MoveAdditive ( [in] DOUBLE  distance,
[in] DOUBLE  velocity,
[in] DOUBLE  acceleration,
[in] DOUBLE  deceleration,
[in] DOUBLE  jerk 
)

This function commands an additive movement. The additive position is added to the target position and is used as new target. It can be used to add a relative position to the already commanded movement.

Parameters
[in]distanceDistance in drives unit.
[in]velocityVelocity in drives unit.
[in]accelerationAcceleration in drives unit.
[in]decelerationDeceleration in drives unit.
[in]jerkJerk in drives unit.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// move with constant velocity
connection.Motion.Axes[axisNr].Movement.MoveAdditive(90, 10, 10, 10, 0);
// wait with timeout until axis reached distance
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionMoveAdditive, where you can find further documentation.
HRESULT IMovement::Stop ( [in] VARIANT_BOOL  stop,
[in] DOUBLE  deceleration,
[in] DOUBLE  jerk 
)

This function stops the axis. The target position is set and the axis will perform a trapezoidal velocity move.

Note
After calling this function with TRUE, you have to call it again with FALSE to get axis from state 'Stopping' to state 'Standstill' command and to make the axis accept new commands.
Parameters
[in]stopTRUE: stopping, FALSE: exit Stopping mode.
[in]decelerationDeceleration in drives unit.
[in]jerkJerk in drives unit.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// move with constant velocity
connection.Motion.Axes[axisNr].Movement.Stop(true, 100, 0);
// wait with timeout till axis has stopped
connection.Motion.Axes[axisNr].Movement.Wait(10000);
// deactivate stopping to allow next movement command
connection.Motion.Axes[axisNr].Movement.Stop(false, 100, 0);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionStop, where you can find further documentation.
HRESULT IMovement::GearIn ( [in] AxisRef *  masterAxis,
[in] LONG  numerator,
[in] LONG  denominator,
[in] DOUBLE  fineadjust 
)

This function commands a velocity synchronization to the master.

Parameters
[in]masterAxisReference to the master axis.
[in]numeratorGear ratio numerator.
[in]denominatorGear ratio denominator.
[in]fineadjustFine adjust for gear in %.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// we command axis 2 as our master axis
AxisRef masterAxis = new AxisRef();
masterAxis.axisNo = 2;
// gear in to master axis and follow with velocity
connection.Motion.Axes[axisNr].Movement.GearIn(ref masterAxis, 1, 1, 0);
// wait with timeout till axis has synchronized
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionGearIn, where you can find further documentation.
HRESULT IMovement::GearInPos ( [in] AxisRef *  masterAxis,
[in] LONG  numerator,
[in] LONG  denominator,
[in] DOUBLE  fineadjust,
[in] StartMode  startMode,
[in] SyncDirection  syncMode 
)

This function commands a position synchronization to the master.

Parameters
[in]masterAxisReference to the master axis.
[in]numeratorGear ratio numerator.
[in]denominatorGear ratio denominator.
[in]fineadjustFine adjust for gear in %.
[in]startModeStart mode.
[in]syncModeSynchronization type.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// we command axis 2 as our master axis
AxisRef masterAxis = new AxisRef();
masterAxis.axisNo = 2;
// gear in to master axis and follow with position
connection.Motion.Axes[axisNr].Movement.GearInPos(ref masterAxis, 1, 1, 0, StartMode.STARTMODE_ABSOLUTE, SyncDirection.SYNC_SHORTESTWAY);
// wait with timeout till axis has synchronized
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionGearInPos, where you can find further documentation.
HRESULT IMovement::FlexProfile ( [in] AxisRef *  masterAxis,
[in] LONG  numerator,
[in] LONG  denominator,
[in] DOUBLE  fineadjust,
[in] LONG  setSelection,
[in] VARIANT_BOOL  useSwitchingPos,
[in] DOUBLE  switchingPosition,
[in] ProfileStartPoint  profileEntry,
[in] DOUBLE  masterOffset,
[in] DOUBLE  slaveOffset,
[in] SyncType  syncMode,
[in] DOUBLE  syncVelocity,
[in] DOUBLE  syncAcceleration,
[in] ProfileExecutionMode  executionMode 
)

This function commands a synchronization movement to an axis.

Parameters
[in]masterAxisReference to the master axis
[in]numeratorGear ratio numerator.
[in]denominatorGear ratio denominator.
[in]fineadjustFine adjust for gear in %.
[in]setSelectionSelects the active set
[in]useSwitchingPosDetermines if switching position will be used.
[in]switchingPositionSwitching position.
[in]profileEntrySwitching conditions.
[in]masterOffsetMaster offset.
[in]slaveOffsetSlave offset.
[in]syncModeSynchronization type
[in]syncVelocitySynchronization velocity.
[in]syncAccelerationSynchronization acceleration.
[in]executionModeExecution mode.
Returns
Return value indicating success (>=0) or error (<0).
Example C#
try
{
// we command the axis with logical address 1
int axisNr = 1;
// we command axis 2 as our master axis
AxisRef masterAxis = new AxisRef();
masterAxis.axisNo = 2;
// gear into master axis and follow with FlexProfile
connection.Motion.Axes[axisNr].Movement.FlexProfile(ref masterAxis, 1, 1, 0, 0, false, 0.0,
ProfileStartPoint.SLAVE_ORIGIN_MASTER_ORIGIN, 0, 0,
SyncType.SYNC_RAMPIN_SHORTESTWAY, 10, 10, ProfileExecutionMode.EXECUTE_CYCLIC);
// wait with timeout until axis has synchronized
connection.Motion.Axes[axisNr].Movement.Wait(10000);
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionFlexProfile, where you can find further documentation.
HRESULT IMovement::Status ( [out, retval] struct MotionStatus *  motionStatus)

This function reads the movement status. It returns information about the last started motion command.

Parameters
[out]motionStatusReturns a struct with information about the last commanded movement.
Returns
Return value indicating success (>=0) or error (<0).
Example C#:
try
{
// we command the axis with logical address 1
int axisNr = 1;
// switch axis to power
connection.Motion.Axes[axisNr].Movement.Power(true);
connection.Motion.Axes[axisNr].Movement.Wait(10000);
// move with constant velocity
connection.Motion.Axes[axisNr].Movement.MoveVelocity(10, 10, 10, 0);
connection.Motion.Axes[axisNr].Movement.Wait(10000);
// check the status of the motion command. should be in
// "done" if axis has reached commanded velocity
MotionStatus motionStatus = connection.Motion.Axes[axisNr].Movement.Status();
Console.WriteLine("Aborted: " + ((motionStatus.aborted == -1) ? "true" : "false"));
Console.WriteLine("Active: " + ((motionStatus.active == -1) ? "true" : "false"));
Console.WriteLine("Done: " + ((motionStatus.done == -1) ? "true" : "false"));
Console.WriteLine("Error: " + ((motionStatus.error == -1) ? "true" : "false"));
Console.WriteLine("ErrorID: " + motionStatus.errorID.ToString());
Console.WriteLine("Table: " + motionStatus.table.ToString());
Console.WriteLine("Additional1: " + motionStatus.additional1.ToString());
Console.WriteLine("Additional2: " + motionStatus.additional2.ToString());
}
catch (System.Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Note:
This method maps to the mlpiCore function mlpiMotionGetStatus, where you can find further documentation.
HRESULT IMovement::Wait ( VARIANT  timeoutValue)

This function waits for completion (state DONE or ERROR) of the latest motion command.

Parameters
[in]timeoutValueTimeout in milliseconds. If DONE or ERROR has not been reached within this time, then an exception will be thrown.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function utilMotionWait, where you can find further documentation.
HRESULT IMovement::PhasingSlave ( [in] DOUBLE  phaseShift,
[in] DOUBLE  velocity,
[in] DOUBLE  acceleration,
[in] DOUBLE  deceleration 
)

The function adjusts the slave axis with the specified velocity and acceleration.

Parameters
[in]phaseShiftMaster axis position additive
[in]velocityValue of the maximum velocity (always positive) (not necessarily reached) [u/s].
[in]accelerationValue of the acceleration (always positive) (increasing energy of the motor) [u/s2]
[in]decelerationValue of the deceleration (always positive) (decreasing energy of the motor) [u/s2]
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionPhasingSlave, where you can find further documentation.
HRESULT IMovement::Phasing ( [in] DOUBLE  phaseShift,
[in] DOUBLE  velocity,
[in] DOUBLE  acceleration,
[in] DOUBLE  deceleration 
)

The function adjusts the master axis with the specified velocity and acceleration.

Parameters
[in]phaseShiftMaster axis additive position
[in]velocityValue of the maximum velocity (always positive) (not necessarily reached) [u/s].
[in]accelerationValue of the acceleration (always positive) (increasing energy of the motor) [u/s2]
[in]decelerationValue of the deceleration (always positive) (decreasing energy of the motor) [u/s2]
Returns
Return value indicating success (>=0) or error (<0). //!
Note:
This method maps to the mlpiCore function mlpiMotionPhasing, where you can find further documentation.
HRESULT IMovement::TorqueControl ( [in] DOUBLE  torque,
[in] DOUBLE  torqueRamp 
)

The function carries out a specific torque on a axis.

Parameters
[in]torqueValue of target torque
[in]torqueRampValue of torque difference within ramp time
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionTorqueControl, where you can find further documentation.
HRESULT IMovement::CamIn ( [in] AxisRef *  masterAxis,
[in] LONG  numerator,
[in] LONG  denominator,
[in] DOUBLE  fineadjust,
[in] DOUBLE  camShaftDistance,
[in] SyncDirection  syncMode,
[in] StartMode  startMode,
[in] CamTableId  camId 
)

This function commands a synchronization movement to an axis.

Parameters
[in]masterAxisReference to the master axis
[in]numeratorGear ratio numerator.
[in]denominatorGear ratio denominator.
[in]fineadjustFine adjust for gear in %.
[in]camShaftDistanceCam shaft distance
[in]syncModeSynchronization type
[in]startModeSynchronization start mode
[in]camIdused cam table
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionCamIn, where you can find further documentation.
HRESULT IMovement::SynchronOut ( )

This function commands a synchronization out to an axis.

Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionSynchronOut, where you can find further documentation.
HRESULT IMovement::OpenCyclicPositionChannel ( )

This function opens a cyclic channel to an axis. As soon as the channel is open, you can write cyclic positions by using WriteCyclicPosition.

Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionOpenCyclicPositionChannel, where you can find further documentation.
HRESULT IMovement::OpenCyclicVelocityChannel ( )

This function opens a cyclic channel to an axis. As soon as the channel is open, you can write cyclic positions by using WriteCyclicVelocity.

Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionOpenCyclicVeloctiyChannel, where you can find further documentation.
HRESULT IMovement::OpenCyclicAnalogChannel ( )

This function opens a cyclic channel to an axis. As soon as the channel is open, you can write cyclic positions by using WriteCyclicAnalog.

Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionOpenCyclicAnalogChannel, where you can find further documentation.
HRESULT IMovement::OpenCyclicTorqueChannel ( )

This function opens a cyclic channel to an axis. As soon as the channel is open, you can write cyclic positions by using WriteCyclicTorque.

Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionOpenCyclicTorqueChannel, where you can find further documentation.
HRESULT IMovement::WriteCyclicPosition ( [in] DOUBLE  cyclicValue)

This function commands a cyclic value to an axis.

Parameters
[in]cyclicValueCyclic value to be written to the channel.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionWriteCyclicPosition, where you can find further documentation.
HRESULT IMovement::WriteCyclicVelocity ( [in] DOUBLE  cyclicValue)

This function commands a cyclic value to an axis.

Parameters
[in]cyclicValueCyclic value to be written to the channel.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionWriteCyclicVelocity, where you can find further documentation.
HRESULT IMovement::WriteCyclicAnalog ( [in] DOUBLE  cyclicValue)

This function commands a cyclic value to an axis.

Parameters
[in]cyclicValueCyclic value to be written to the channel.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionWriteCyclicAnalog, where you can find further documentation.
HRESULT IMovement::WriteCyclicTorque ( [in] DOUBLE  cyclicValue)

This function commands a cyclic value to an axis.

Parameters
[in]cyclicValueCyclic value to be written to the channel.
Returns
Return value indicating success (>=0) or error (<0).
Note:
This method maps to the mlpiCore function mlpiMotionWriteCyclicTorque, where you can find further documentation.

The documentation for this interface was generated from the following file: