Jog

Jog moves an axis continuously at the specified velocity. After you send a Jog command, the axis will accelerate to the specified velocity and keeps moving at that speed, until you stop it.

Functions

JogAxis: moves an axis at a specified velocity without a target or distance. The axis keeps moving until it is stopped.

GetAnAxisVelocity: displays the velocity of an axis. For further details, see Get and set values.

GetAnAxisPosition: displays the end position of an axis. For further details, see Get and set values.

JogAxis

JogAxis makes a Jog move. Its direction is controlled by the Direction parameter. It can be mcPositiveDirection or mcNegativeDirection. See the McDirection type.

Stop a Jog move

You can use HaltAxis or StopAxis to stop a Jog move. For more information about how to use these functions, see Stop a movement.

Code

In SingleAxisMotion.cpp, add the following code:

Copy

JogAxis

VOID Jog(int Index)
{
    RtPrintf("Make a jog move.\n\n");

    //Start a jog move.
    KsCommandStatus status = JogAxis(Index, MAXIMUM_VELOCITY, MAXIMUM_ACCELERATION,
        MAXIMUM_DECELERATION, MAXIMUM_JERK, mcNegativeDirection);
    if (status.Error)
        RtPrintf("JogAxis failed: %d\n", status.ErrorId);

    //Let the axis moves for a while.
    Sleep(5000);

    GetAnAxisVelocity(Index);

    RtPrintf("End position:\n");
    GetAnAxisPosition(Index);
}

 

Output: