The RMP Motion Controller APIs

◆ StateGet()

RSIState StateGet ( )
Description:
StateGet returns the current state of the Axis or MultiAxis.
Returns
(RSIState) The current state of the Axis or MultiAxis.
Remarks
This function is also available in RapidSequencer.

Part of the State and Status method group.

Sample Code:
AxisStatus
// CHECK AXIS STATE
RSIState state = axis.StateGet(); // StateGet will return RSIState enum name of the current state of the Axis or MultiAxis. (Ex: RSIStateERROR)
Console.WriteLine("Your Axis is in state: " + state);
switch (state)
{
case RSIState.RSIStateIDLE:
case RSIState.RSIStateMOVING:
break;
case RSIState.RSIStateERROR:
case RSIState.RSIStateSTOPPING_ERROR:
case RSIState.RSIStateSTOPPED:
case RSIState.RSIStateSTOPPING:
RSISource source = axis.SourceGet(); // SourceGet will return the RSISource enum name of the first status bit that is active. (Ex: RSISourceAMP_FAULT)
Console.WriteLine("Your Axis is in state: " + state);
Console.WriteLine("The source of the axis error is: " + axis.SourceNameGet(source)); // SourceNameGet will return the first status bit which is set on an Axis or MultiAxis.
break;
default:
Console.WriteLine("");
break;
}
// or USE STATUS BIT GET
bool isAmpFault_Active = axis.StatusBitGet(RSIEventType.RSIEventTypeAMP_FAULT); // StatusBitGet returns the state of a status bit, true or false.
bool isPositionErrorLimitActive = axis.StatusBitGet(RSIEventType.RSIEventTypeLIMIT_ERROR);
bool isHWNegativeLimitActive = axis.StatusBitGet(RSIEventType.RSIEventTypeLIMIT_HW_NEG);
bool isHWPostiveLimitActive = axis.StatusBitGet(RSIEventType.RSIEventTypeLIMIT_HW_POS); // This can be done for all RSIEventTypes
RapidSetup:
Go to the Axis or MultiAxis screen -> Status.
Various states an axis can be found in.
See also
RSIState, SourceGet
Examples
SyncOutputWithMotion.cpp, and UpdateBufferPoints.cpp.
RSI::RapidCode::RSIEventType
RSIEventType
Event Types or Status Bits.
Definition: rsienums.h:873
RSI::RapidCode::RSISource
RSISource
Possible sources that have caused an Error state.
Definition: rsienums.h:920
RSI::RapidCode::RSIState
RSIState
State of an Axis or MultiAxis.
Definition: rsienums.h:786