using RSI.RapidCode.dotNET;
using NUnit.Framework;
using System;
[TestFixture]
[Category("Software")]
class AxisStatusSample : SampleAppTestBase
{
[Test, Timeout(Constants.MAX_TEST_TIME)]
public void AxisStatus()
{
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:
Console.WriteLine("Your Axis is in state: " + state);
Console.WriteLine(
"The source of the axis error is: " + axis.
SourceNameGet(source));
break;
default:
Console.WriteLine("");
break;
}
bool isAmpFault_Active = axis.
StatusBitGet(RSIEventType.RSIEventTypeAMP_FAULT);
bool isPositionErrorLimitActive = axis.
StatusBitGet(RSIEventType.RSIEventTypeLIMIT_ERROR);
bool isHWNegativeLimitActive = axis.
StatusBitGet(RSIEventType.RSIEventTypeLIMIT_HW_NEG);
bool isHWPostiveLimitActive = axis.
StatusBitGet(RSIEventType.RSIEventTypeLIMIT_HW_POS);
}
}
const char *const SourceNameGet(RSISource source)
Get the name (string) of the source of an error for an Axis or MultiAxis.
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.