Learn how to read axis status and check for errors.
Console.WriteLine("📜 Axis: Status");
int exitCode = 0;
try
{
Helpers.VerifyHardwareUsage(controller);
Helpers.VerifyAxisCount(controller);
Console.WriteLine($"Your Axis is in state: {state}");
switch (state)
{
break;
Console.WriteLine($"The source of the axis error is: {axis.SourceNameGet(source)}");
break;
default:
Console.WriteLine("Axis is in an unexpected state.");
break;
}
Console.WriteLine($"Amp Fault Active: {isAmpFaultActive}");
Console.WriteLine($"Position Error Limit Active: {isPosErrLimActive}");
Console.WriteLine($"HW Negative Limit Active: {isHwNegLimActive}");
Console.WriteLine($"HW Positive Limit Active: {isHwPosLimActive}");
}
catch (Exception e)
{
Console.WriteLine($"❌ Error: {e.Message}");
}
finally
{
controller.Delete();
}
return exitCode;
Constants used in the C# sample apps.
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.
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...
bool StatusBitGet(RSIEventType bitMask)
Return the state of a status bit.
RSIState StateGet()
Get the Axis or MultiAxis state.
RSISource SourceGet()
Get the source of an error state for an Axis or MultiAxis.
RSIEventType
Event Types or Status Bits.
RSISource
Possible sources that have caused an Error state.
Helpers namespace provides utility functions for common tasks in RMP applications.