MoveLinearRelative
Commands an interpolated linear movement on an axis group from the current position of the tool center point to a relative position in the specified coordinate system. The relative distance is added to the current set position at the time of the execution.
Syntax
KsCommandStatus MoveLinearRelative(
int Index,
int Length,
double* Distance,
double Velocity,
double Acceleration,
double Deceleration,
double Jerk,
McCoordSystem CoordSystem,
McBufferMode BufferMode,
McTransitionMode TransitionMode,
double* TransitionParameter
);
Parameters
Index [in]: the index of an axis group. Indexes are zero based. Aliases affect this parameter. You can have up to 32 groups.
Length [in]: the length of the Distance array.
Distance [in]: the array [1..N] of relative distance for each dimension in the specified coordinate system. N is 64.
Velocity [in]: the maximum velocity of the path for the coordinate system in which the path is defined. Always positive. Not necessarily reached. [unit/second]
Acceleration [in]: the maximum acceleration. Always positive. Not necessarily reached. The unit is determined by the McProfileType type. [unit/second2] or [second]
Deceleration [in]: the maximum deceleration. Always positive. Not necessarily reached. The unit is determined by the McProfileType type. [unit/second2] or [second]
Jerk [in]: the maximum jerk. Always positive. Not necessarily reached. The unit is determined by the McProfileType type. [unit/second3] or [second]
CoordSystem [in]: a coordinate system. See the McCoordSystem type.
BufferMode [in]: defines how to blend the velocity of two functions. See the McBufferMode type.
TransitionMode [in]: inserts a transition curve. See the McTransitionMode type.
TransitionParameter [in]: the additional parameter for the transition mode. If TransitionMode is set to mcNone
, this parameter has no effect.
Return value
Returns the KsCommandStatus structure.
Remarks
- For more information about how absolute, relative, and additive work, see Concepts > Motion.
- For more information about how the blending modes work, see Concepts > Blend movements.
Example
VOID MoveRelative(INT Group, DOUBLE DistanceX, DOUBLE DistanceY) {
DOUBLE Distance[2] = { DistanceX, DistanceY };
//Start an relative move.
KsCommandStatus move = WaitForCommand(30, TRUE, MoveLinearRelative(Group, 2, Distance,
3600, 36000, 36000, 3600000,
mcAxisCoordSystem, mcAborting, mcNone, NULL));
DOUBLE Position[2] = { 0, 0 };
GetGroupActualPosition(Group, mcAxisCoordSystem, mcActualValue, 2, Position);
RtPrintf("Current Position: %d,%d\n", (int)Position[0], (int)Position[1]);
}
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.0 | 4.0 |
Header | ksmotion.h | ksmotion.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also