GetAnAxisPosition

GetAxisPosition gets the set and actual positions of an axis. You can use it to check where the axis is. When you use this function, you may want to display the position or pass the value of the position to somewhere for other uses. In GetAnAxisPosition we display the position so you know whether an axis finish its move.

Copy

GetAnAxisPosition

VOID GetAnAxisPosition(int& Index)
{
    //Display the end position of an axis.

    double setPosition = 0;
    double actualPosition = 0;
    KsError nRet = errNoError;

    //Get the set position of the axis.
    nRet = GetAxisPosition(Index, mcSetValue, &setPosition);
    if (nRet != errNoError)
        RtPrintf("Unable to get the set position: %x\n", nRet);

    //Get the actual position of the axis.
    nRet = GetAxisPosition(Index, mcActualValue, &actualPosition);
    if (nRet != errNoError)
        RtPrintf("Unable to get the actual position: %x\n", nRet);

    printf("Set position: %f, Actual position: %f\n\n", setPosition, actualPosition);
}