Inch group

Inch group moves a group at the specified velocity, just like Jog group, but it has a specified distance. After the group travels the distance, it stops.

Functions

InchGroup: moves a group at a specified velocity with a maximum distance. The group stops after it travels the distance.

WaitForCommand: waits for a command to be finished.

GetAGroupPosition: displays the end position of a group. For further details, see Get and set group values.

Code

In GroupMotion.cpp, add the following code:

Copy

InchGroup

VOID GroupInch(int Group)
{
    RtPrintf("Make an inch group move.\n\n");

    const int LENGTH = 3;   //The length of the Velocity and Distance arrays.
    double Velocity[LENGTH] = { 3000, 3600, 3200 };
    double Distance[LENGTH] = { 4000, 5000, 4500 };

    //Start an inch move.
    KsCommandStatus inchMove = WaitForCommand(30, FALSE, InchGroup(Group, LENGTH,
        Distance, Velocity, MAXIMUM_ACCELERATION, MAXIMUM_DECELERATION, MAXIMUM_JERK,
        mcAxisCoordSystem));

    RtPrintf("End positions:\n\n");
    GetAGroupPosition(Group);
}

 

Output: