APIs, concepts, guides, and more
axis-config-settling.cs
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 Axis Config Settling");
// get rmp objects
using MotionController controller = MotionController.Get();
try
{
Helpers.CheckErrors(controller);
Axis axis = controller.AxisGet(Constants.AXIS_INDEX);
double POSITION_TOLERANCE_FINE = 200; // Specify the fine position tolerance.
double POSITION_TOLERANCE_COARSE = 300; // Specify the coarse position tolerance.
double VELOCITY_TOLERANCE = 12000; // Specify the velocity tolerance.
double SETTLING_TIME = 5; // Specify the settling time.
// set
axis.PositionToleranceFineSet(POSITION_TOLERANCE_FINE); // Set fine position tolerance.
axis.PositionToleranceCoarseSet(POSITION_TOLERANCE_COARSE); // Set coarse position tolerance.
axis.VelocityToleranceSet(VELOCITY_TOLERANCE); // Set velocity tolerance.
axis.SettlingTimeSet(SETTLING_TIME); // Set settling time (seconds).
// get
double posTolFine = axis.PositionToleranceFineGet();
double posTolCoarse = axis.PositionToleranceCoarseGet();
double velTol = axis.VelocityToleranceGet();
double setTime = axis.SettlingTimeGet();
Console.WriteLine($"Position Tolerance Fine: {posTolFine}");
Console.WriteLine($"Position Tolerance Coarse: {posTolCoarse}");
Console.WriteLine($"Velocity Tolerance: {velTol}");
Console.WriteLine($"Settling Time: {setTime}");
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
Constants used in the C# sample apps.
const int AXIS_INDEX
Default: 0.
Definition _constants.cs:12
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Definition _helpers.cs:15
Helpers class provides static methods for common tasks in RMP applications.
Definition _helpers.cs:5
double SettlingTimeGet()
Get the Settling time.
void PositionToleranceCoarseSet(double tolerance)
Set the Coarse Position Tolerance for Axis settling.
double PositionToleranceFineGet()
Get the Fine Position Tolerance for axis settling.
void PositionToleranceFineSet(double tolerance)
Set the Fine Position Tolerance for Axis settling.
void VelocityToleranceSet(double tolerance)
Set the Velocity Tolerance used for settling.
double PositionToleranceCoarseGet()
Get the Coarse Position Tolerance for axis settling.
double VelocityToleranceGet()
Get the velocity tolerance used for settling.
void SettlingTimeSet(double time)
Set the settling time.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Definition rsi.h:5870
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
static MotionController * Get()
Get an already running RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
Definition rsi.h:800