APIs, concepts, guides, and more

◆ ConfigurePhantomAxis()

static void ConfigurePhantomAxis ( Axis phantomAxis)
static
Parameters
phantomAxisAxis object of type RSIMotorTypePHANTOM.
Code Snippet
public static void ConfigurePhantomAxis(Axis phantomAxis)
{
if (phantomAxis.MotorTypeGet() != RSIMotorType.RSIMotorTypePHANTOM)
{
throw new Exception($"Axis {phantomAxis.NumberGet()} is not configured as a phantom axis. Please ensure the axis is set to phantom before calling ConfigurePhantomAxis.");
}
// disable all limits (not used for phantom axes)
phantomAxis.ErrorLimitActionSet(RSIAction.RSIActionNONE);
phantomAxis.HardwareNegLimitActionSet(RSIAction.RSIActionNONE);
phantomAxis.HardwarePosLimitActionSet(RSIAction.RSIActionNONE);
phantomAxis.HomeActionSet(RSIAction.RSIActionNONE);
phantomAxis.SoftwareNegLimitActionSet(RSIAction.RSIActionNONE);
phantomAxis.SoftwarePosLimitActionSet(RSIAction.RSIActionNONE);
// set position tolerances to max value for immediate MotionDone
double POSITION_TOLERANCE_MAX = Double.MaxValue / 10.0;
phantomAxis.PositionToleranceCoarseSet(POSITION_TOLERANCE_MAX);
phantomAxis.PositionToleranceFineSet(POSITION_TOLERANCE_MAX);
// clear any faults
phantomAxis.Abort();
phantomAxis.ClearFaults();
// check for idle state
if (phantomAxis.StateGet() != RSIState.RSIStateIDLE)
{
RSISource source = phantomAxis.SourceGet(); // get state source enum
string errorMsg = @$"Axis {phantomAxis.NumberGet()} failed to enter IDLE state after configuring phantom axis.
The source of the axis error is: {phantomAxis.SourceNameGet(source)}";
throw new Exception(errorMsg);
}
}
Examples
_setup.cs, gcode-motion.cs, gcode-units.cs, io-sync-outputs.cs, path-3d-points.cs, path-motion.cs, and path-setup-gantry.cs.

Definition at line 144 of file _helpers.cs.