EnableAxisUnitConversion

Enables the axis to use a real-world unit. Changing the unit affects the position and velocity. You need to update MinimumFollowingError, MaximumFollowingError in McProfileSettings and MinimumOutput, MaximumOutput in McPidSettings.

Syntax

KsError EnableAxisUnitConversion(
     int Index,
     BOOL Active
);

Parameters

Index: the index of an axis. Indexes are zero based. Aliases affect this parameter.

Active: TRUE: use a real-world unit. FALSE: use the count 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

Example

VOID ConfigureUnit(INT Index) {
   SlaveStatus moduleStatus = { 0 };
   int resolution = 0;
   KsError nRet = GetAxisByIndex(Index, &moduleStatus, &resolution, NULL, NULL);
   nRet = SetAxisCountsPerUnit(Index, resolution, UNITS_PER_REVOLUTION, FALSE);
   nRet = EnableAxisUnitConversion(Index, TRUE);
}

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header ksmotion.h ksmotion.h
Library KsApi_Rtss.lib KsApi.lib

See also

SetAxisCountsPerUnit

SetAxisMotionProfile

SetAxisSecondEncoderCountsPerUnit