SetAxisPosition
Sets the target position of an axis.
Syntax
KsError SetAxisPosition(
int Index,
double Position
);
Parameters
Index: the index of an axis. Indexes are zero based. Aliases affect this parameter.
Position: the target position of an axis in user unit.
Return value
If the function succeeds, it returns errNoError
, otherwise an error code. For more information about the error code, see the KsError list.
Remarks
- This function can be used only in the Direct Position, PID Velocity, and PID Torque control modes, in which this is the only function to set the target position of an axis.
- When modulo axis is enabled, the modulo value is applied to the input position. The axis uses the shortest path to update the target position in order to prevent command jumps. For example, if the modulo value is 360 and the input position is 350, the axis moves 10° in the negative direction.
Example
Copy
KsError nRet = SetAxisPosition(0, 5000);
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.0 | 4.0 |
Header | ksmotion.h | ksmotion.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also