APIs, concepts, guides, and more
|
|
static |
controller | Pointer to the MotionController containing the axis. |
axisNumber | The number of the axis to configure as a phantom axis. |
SystemException | Thrown if an invalid axis number is provided. {
// Check if the axis number is valid
if (axisNumber < 0)
{
throw new SystemException("Error: " + axisNumber.ToString() + " is invalid. Axis numbers cannot be negative.");
}
if (axisNumber >= controller.AxisCountGet())
{
throw new SystemException("Error: " + axisNumber.ToString() + " is invalid. Axis numbers cannot be greater than the number of axes on the controller.");
}
// Configure the specified axis as a phantom axis
HelperFunctionsCS.CheckErrors(axis); // [Helper Function] Check that the axis has been initialized correctly
// These limits are not meaningful for a Phantom Axis (e.g., a phantom axis has no actual position so a position error trigger is not necessary)
// Therefore, you must set all of their actions to "NONE".
axis.PositionSet(0); // Set the position to 0
const double positionToleranceMax = Double.MaxValue / 10.0; // Reduce from max slightly, so XML to string serialization and deserialization works without throwing System.OverflowException
axis.PositionToleranceCoarseSet(positionToleranceMax); // Set Settling Coarse Position Tolerance to max value
axis.PositionToleranceFineSet(positionToleranceMax); // Set Settling Fine Position Tolerance to max value (so Phantom axis will get immediate MotionDone when target is reached)
}
|
Definition at line 212 of file HelperFunctionsCS.cs.