APIs, concepts, guides, and more

◆ AxisCountGet()

int32_t AxisCountGet ( )
Description:
AxisCountGet returns the number of axes processing on the controller.
Returns
(int32_t) The axis count.

Part of the MotionController-Information method group.

Sample Code:
Axis: Configuration
// add phantom axis
controller.AxisCountSet(controller.AxisCountGet() + 1);
// get phantom axis
int axisNumber = controller.AxisCountGet() - 1; // last axis [zero-based]
Axis axis = controller.AxisGet(axisNumber);
// disable all limits (not used for phantom axes)
axis.ErrorLimitActionSet(RSIAction.RSIActionNONE);
axis.HardwareNegLimitActionSet(RSIAction.RSIActionNONE);
axis.HardwarePosLimitActionSet(RSIAction.RSIActionNONE);
axis.HomeActionSet(RSIAction.RSIActionNONE);
axis.SoftwareNegLimitActionSet(RSIAction.RSIActionNONE);
axis.SoftwarePosLimitActionSet(RSIAction.RSIActionNONE);
double POSITION_TOLERANCE_MAX = Double.MaxValue / 10.0; // reduce from max slightly, so XML to string serialization and deserialization works without throwing System.OverflowException
axis.PositionToleranceCoarseSet(POSITION_TOLERANCE_MAX); // set Settling Coarse Position Tolerance to max value
axis.PositionToleranceFineSet(POSITION_TOLERANCE_MAX); // set Settling Fine Position Tolerance to max value (so Phantom axis will get immediate MotionDone when target is reached)
axis.MotorTypeSet(RSIMotorType.RSIMotorTypePHANTOM); // set the MotorType to phantom
Note
The standard default is now zero.
See also
AxisCountSet
Examples
DifferenceOfPositionUserLimit.cpp, HelperFunctions.cs, MultiaxisMotion.cpp, PVTmotionMultiAxis.cpp, PathMotion.cpp, SampleAppsHelper.h, SyncOutputWithMotion.cpp, Template.cpp, _setup.cs, and axis-config-phantom-axis.cs.