Learn how to read axis status and check for errors.
- 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.
In this page:
📜 Check Axis State
Learn how to check the current Status & Faults 📖 of an axis and identify the source of errors. Use Axis.StateGet to retrieve the current state, Axis.SourceGet to identify the first active error source, and Axis.SourceNameGet to get a human-readable name of the error source.
Console.WriteLine("📜 Axis: Status");
try
{
Axis axis = controller.
AxisGet(Constants.AXIS_0_INDEX);
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}");
}
finally
{
}
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Helpers class provides static methods for common tasks in RMP applications.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
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...
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.
Source: axis-status.cs