homingOnPosition
homingOnPosition sets an axis' current position as the home position.
Process for using homingOnPosition
Since homingOnPosition uses the current position as home, we only need HomeAxis to finish the job.
Functions
HomeAxis: commands an axis to perform the "search home" sequence.
Code
In Homing.cpp
, add the following code:
Copy
homingOnPosition
VOID HomingOnPosition(int Index)
{
RtPrintf("Home an axis using homingOnPosition.\n\n");
KsCommandStatus home = WaitForCommand(30, TRUE, HomeAxis(Index, 0, HOMING_HIGH_VELOCITY,
HOMING_LOW_VELOCITY, HOMING_ACCELERATION, HOMING_DECELERATION, MAXIMUM_JERK,
HOMING_DIRECTION, homingOnPosition));
if (home.Error)
RtPrintf("homingOnPosition failed: %d\n", home.ErrorId);
else if (home.Done)
RtPrintf("homingOnPosition is completed.\n\n");
}
Output: