Console.WriteLine("📜 User Limit: Feed Rate Change at Position");
const int CONDITION = 0;
const double POSITION_TRIGGER_VALUE = 5.0;
const double DEFAULT_FEED_RATE = 1.0;
const double DESIRED_FEED_RATE = 2.0;
const int DURATION = 0;
try
{
controller.UserLimitCountSet(1);
controller.InterruptEnableSet(true);
Console.WriteLine($"Initial Feed Rate: {axis.FeedRateGet()}");
controller.UserLimitConditionSet(
number: 0,
conditionNumber: CONDITION,
limitValueDouble: POSITION_TRIGGER_VALUE);
controller.UserLimitConfigSet(
number: 0,
duration: DURATION);
controller.UserLimitOutputSet(
number: 0,
limitValueDouble: DESIRED_FEED_RATE,
enabled: true);
Console.WriteLine($"Moving to position {POSITION_TRIGGER_VALUE + 1}...");
Console.WriteLine($"Feed rate will change to {DESIRED_FEED_RATE} when position > {POSITION_TRIGGER_VALUE}");
Console.WriteLine($"Final Feed Rate: {finalFeedRate}");
if (finalFeedRate == DESIRED_FEED_RATE)
Console.WriteLine("✓ User limit triggered - feed rate changed successfully");
else
Console.WriteLine($"✗ Feed rate did not change (expected: {DESIRED_FEED_RATE}, actual: {finalFeedRate})");
controller.UserLimitDisable(0);
controller.UserLimitCountSet(0);
Console.WriteLine("\nUser limit feed rate change complete.");
}
finally
{
controller.Delete();
}
Constants used in the C# sample apps.
const int AXIS_0_INDEX
Default: 0.
uint64_t AddressGet(RSIAxisAddressType addressType)
Get the an address for some location on the Axis.
void MoveSCurve(double position, double vel, double accel, double decel, double jerkPct)
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...
int32_t MotionDoneWait()
Waits for a move to complete.
double FeedRateGet()
Get the axis feed rate.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
void FeedRateSet(double rate)
Set the feed rate for an Axis.
int32_t NumberGet()
Get the axis number.
RSIUserLimitLogic
Logic options for User Limits.
RSIAction
Action to perform on an Axis.
RSIAxisAddressType
Used to get firmware address used in User Limits, Recorders, etc.
RSIUserLimitTriggerType
Trigger types for UserLimits.
Helpers namespace provides utility functions for common tasks in RMP applications.