APIs, concepts, guides, and more
axis-config-settling.cs
Note
See Axis: Configuration 📜 for a detailed explanation of this sample code.
Warning
This is a sample program to assist in the integration of the RMP motion controller with your application. It may not contain all of the logic and safety features that your application requires. We recommend that you wire an external hardware emergency stop (e-stop) button for safety when using our code sample apps. Doing so will help ensure the safety of you and those around you and will prevent potential injury or damage.

The sample apps assume that the system (network, axes, I/O) are configured prior to running the code featured in the sample app. See the Configuration page for more information.
/* This sample app demonstrates how to set and get axis settling parameters using
RapidCode .NET API.
*/
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 Axis Config: Settling");
int exitCode = 0;
// get rmp objects
try
{
Helpers.CheckErrors(controller);
Helpers.VerifyHardwareUsage(controller);
Helpers.VerifyAxisCount(controller);
Axis axis = controller.AxisGet(axisNumber: Constants.AXIS_0_INDEX);
Helpers.CheckErrors(axis);
// get
double posTolFine = axis.PositionToleranceFineGet();
double posTolCoarse = axis.PositionToleranceCoarseGet();
double velTol = axis.VelocityToleranceGet();
double setTime = axis.SettlingTimeGet();
// set
axis.PositionToleranceFineSet(posTolFine); // set fine position tolerance.
axis.PositionToleranceCoarseSet(posTolCoarse); // set coarse position tolerance.
axis.VelocityToleranceSet(velTol); // set velocity tolerance.
axis.SettlingTimeSet(setTime); // set settling time (seconds).
Console.WriteLine($"Position Tolerance Fine: {posTolFine}");
Console.WriteLine($"Position Tolerance Coarse: {posTolCoarse}");
Console.WriteLine($"Velocity Tolerance: {velTol}");
Console.WriteLine($"Settling Time: {setTime}");
exitCode = Constants.EXIT_SUCCESS;
}
// handle errors as needed
catch (Exception e)
{
Console.WriteLine($"❌ Error: {e.Message}");
exitCode = Constants.EXIT_FAILURE;
}
finally
{
controller.Delete(); // dispose
}
return exitCode;
Constants used in the C# sample apps.
Definition _constants.cs:3
const int EXIT_FAILURE
Exit code for failed execution.
Definition _constants.cs:69
const int AXIS_0_INDEX
Default: 0.
Definition _constants.cs:20
const int EXIT_SUCCESS
Exit code for successful execution.
Definition _constants.cs:68
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:5921
static MotionController * Get()
Get an already running RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
Definition rsi.h:800
Helpers namespace provides utility functions for common tasks in RMP applications.
Definition helpers.h:21