- 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.
Console.WriteLine("📜 Axis Config: UserUnits");
int exitCode = 0;
double defaultUserUnits = 1;
try
{
Helpers.VerifyHardwareUsage(controller);
Helpers.VerifyAxisCount(controller);
Console.WriteLine($"User Units: {userUnits}");
}
catch (Exception e)
{
Console.WriteLine($"❌ Error: {e.Message}");
}
finally
{
controller.Delete();
}
return exitCode;
Constants used in the C# sample apps.
const double AXIS_0_USER_UNITS
Default: 1.
const int EXIT_FAILURE
Exit code for failed execution.
const int AXIS_0_INDEX
Default: 0.
const int EXIT_SUCCESS
Exit code for successful execution.
double UserUnitsGet()
Get the number of counts per User Unit.
void UserUnitsSet(double countsPerUserUnit)
Sets the number of counts per User Unit.
void ErrorLimitTriggerValueSet(double triggerValue)
Set the Position Error Limit trigger value.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
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...
Helpers namespace provides utility functions for common tasks in RMP applications.