APIs, concepts, guides, and more
axis-config-hardware-limits.cs
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 Axis Config Hardware Limits");
// get rmp objects
using MotionController controller = MotionController.Get();
try
{
Helpers.CheckErrors(controller);
Axis axis = controller.AxisGet(Constants.AXIS_INDEX);
bool ACTIVE_HIGH = true;
bool ACTIVE_LOW = false;
double HW_POS_DURATION_TIME = 0.01; // Positive limit duration (in seconds)
double HW_NEG_DURATION_TIME = 0.01; // Negative limit duration (in seconds)
// set pos & neg limits
axis.HardwarePosLimitActionSet(RSIAction.RSIActionE_STOP);
axis.HardwarePosLimitDurationSet(HW_POS_DURATION_TIME);
axis.HardwareNegLimitActionSet(RSIAction.RSIActionE_STOP);
axis.HardwareNegLimitDurationSet(HW_NEG_DURATION_TIME);
// get pos & neg limits
RSIAction hPosLimAct = axis.HardwarePosLimitActionGet();
bool hPosLimTrigState = axis.HardwarePosLimitTriggerStateGet();
double hPosLimDur = axis.HardwarePosLimitDurationGet();
RSIAction hNegLimAct = axis.HardwareNegLimitActionGet();
bool hNegLimTrigState = axis.HardwareNegLimitTriggerStateGet();
double hNegLimDur = axis.HardwareNegLimitDurationGet();
Console.WriteLine($"Hardware Positive Limit Action: {hPosLimAct}");
Console.WriteLine($"Hardware Positive Limit Trigger State: {hPosLimTrigState}");
Console.WriteLine($"Hardware Positive Limit Duration: {hPosLimDur}");
Console.WriteLine($"Hardware Negative Limit Action: {hNegLimAct}");
Console.WriteLine($"Hardware Negative Limit Trigger State: {hNegLimTrigState}");
Console.WriteLine($"Hardware Negative Limit Duration: {hNegLimDur}");
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
Constants used in the C# sample apps.
const int AXIS_INDEX
Default: 0.
Definition _constants.cs:12
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Definition _helpers.cs:15
Helpers class provides static methods for common tasks in RMP applications.
Definition _helpers.cs:5
void HardwareNegLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Negative Limit Event triggers.
void HardwareNegLimitDurationSet(double seconds)
Set the duration required before the Hardware Negative Limit event triggers.
void HardwarePosLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Positive Limit Event triggers.
RSIAction HardwarePosLimitActionGet()
Get the action that will occur when the Hardware Positive Limit Event triggers.
void HardwarePosLimitTriggerStateSet(bool state)
sets the trigger state.
double HardwareNegLimitDurationGet()
Get the duration required before the Hardware Negative Limit event triggers.
bool HardwarePosLimitTriggerStateGet()
trigger state return.
void HardwarePosLimitDurationSet(double seconds)
Set the duration required before the Hardware Positive Limit event triggers.
bool HardwareNegLimitTriggerStateGet()
Trigger state return.
double HardwarePosLimitDurationGet()
Get the duration required before the Hardware Positive Limit event triggers.
RSIAction HardwareNegLimitActionGet()
Get the action that will occur when the Hardware Negative Limit Event triggers.
void HardwareNegLimitTriggerStateSet(bool state)
Sets the trigger state.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Definition rsi.h:5870
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...
Definition rsi.h:800
RSIAction
Action to perform on an Axis.
Definition rsienums.h:1115