MoveAxisAbsolute

Commands a controlled motion to a specified absolute position.

Syntax

KsCommandStatus MoveAxisAbsolute(
     int Index,
     double Position,
     double Velocity,
     double Acceleration,
     double Deceleration,
     double Jerk,
     McDirection Direction,
     McBufferMode BufferMode
);

Parameters

Index [in]: the index of an axis. Indexes are zero based. Aliases affect this parameter.

Position [in]: the target position for the motion. [unit] (negative or positive)

Velocity [in]: a value of the maximum velocity. Not necessarily reached if the target position is close. [unit/second]

Acceleration [in]: a value of the acceleration. Always positive. The unit is determined by the McProfileType type. (increasing power of the motor) [unit/second2] or [second]

Deceleration [in]: a value of the deceleration. Always positive. The unit is determined by the McProfileType type. (decreasing power of the motor) [unit/second2] or [second]

Jerk [in]: a value of the jerk. Always positive. The unit is determined by the McProfileType type. [unit/second3] or [second]

Direction [in]: the moving direction of an axis. See the McDirection type.

BufferMode [in]: defines how to blend the velocity of two functions. See the McBufferMode type.

Return value

Returns the KsCommandStatus structure.

Remarks

Example

VOID MoveAbsolute(INT Index, DOUBLE Target) {
   //The direction is reserved for cyclic axes so it is currently ignored.
   //Start an absolute move.
   KsCommandStatus status = WaitForCommand(30, TRUE, MoveAxisAbsolute(Index, Target, 
      3600, 36000, 36000, 3600000, mcPositiveDirection, mcAborting));

   //Print the final position.
   double setPosition = 0;
   KsError nRet = GetAxisPosition(Index, mcSetValue, &setPosition);
   double actPosition = 0;
   nRet = GetAxisPosition(Index, mcSetValue, &actPosition);
   
   RtPrintf("Current Position: Target %d, Actual %d\n", (int)setPosition, (int)actPosition);
}

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header ksmotion.h ksmotion.h
Library KsApi_Rtss.lib KsApi.lib

See also

MoveAxisAdditive

MoveAxisRelative

MoveAxisVelocity