APIs, concepts, guides, and more

◆ AxisCountSet() [1/2]

void AxisCountSet ( int32_t axisCount)
Description:
AxisCountSet will configure the number of axes processed by the controller.
Parameters
axisCountA int32_t value to set AxisCount to.

Part of the Information method group.

Sample Code:
Axis: Configuration
// add phantom axis
controller.AxisCountSet(controller.AxisCountGet() + 1);
// get phantom axis
int axisIndex = controller.AxisCountGet() - 1; // last axis [zero-based]
Axis axis = controller.AxisGet(axisIndex);
// 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
Warning
Important usage instructions for all RapidCode object count set methods:
This should be done after successful MotionController::Create but before any RapidCode object creation, (MotionController::AxisGet, MotionController::MultiAxisGet, etc.) as changing object counts will reconfigure the RMP's dynamic memory allocation which invalidates all preexisting RapidCode objects.
See also
AxisCountSet, MotionCountSet, RecorderCountSet, UserLimitCountSet, MathBlockCountSet, CompensatorCountSet
AxisCountGet
Note
By default, this will also set the number of allocated/enabled MotionSupervisors, Filters, and Motors
Examples
HelperFunctions.cs, MultiAxisMotion.cs, Recorder.cs, SampleAppsHelper.h, UserLimit.cs, UserLimitCommandPositionDirect.cs, _setup.cs, and axis-config-phantom-axis.cs.