Console.WriteLine("📜 User Limit: EStop and Store Position");
const int AXIS_INDEX = 0;
const int INPUT_INDEX = 0;
const int CONDITION = 0;
const int USER_DATA_INDEX = 0;
const double DURATION = 0.125;
try
{
controller.UserLimitCountSet(1);
controller.InterruptEnableSet(true);
controller.UserLimitConditionSet(
number: 0,
conditionNumber: CONDITION,
userLimitMask: (uint)input0.
MaskGet(),
limitValueUInt32: 1);
controller.UserLimitConfigSet(
number: 0,
actionAxis: AXIS_INDEX,
duration: DURATION);
controller.UserLimitInterruptUserDataAddressSet(
number: 0,
userDataIndex: USER_DATA_INDEX,
Console.WriteLine("Axis moving... waiting for input trigger to E-Stop");
while (controller.InterruptWait(250) !=
RSIEventType.RSIEventTypeUSER_LIMIT)
{
}
int triggeredUserLimit = controller.InterruptSourceNumberGet() - 1;
double interruptPosition = controller.InterruptUserDataDoubleGet(USER_DATA_INDEX);
double positionInUserUnits = interruptPosition / axis.
UserUnitsGet();
Console.WriteLine($"✓ User limit triggered - E-Stop executed");
Console.WriteLine($" Triggered User Limit: {triggeredUserLimit}");
Console.WriteLine($" Position at trigger: {positionInUserUnits} (user units)");
controller.UserLimitDisable(0);
controller.UserLimitCountSet(0);
Console.WriteLine("\nUser limit E-Stop store position 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.
double UserUnitsGet()
Get the number of counts per User Unit.
void MoveVelocity(double velocity)
Represents a single axis of motion control. This class provides an interface for commanding motion,...
uint64_t AddressGet()
Get the Host Address for the I/O point.
static IOPoint * CreateDigitalInput(Axis *axis, RSIMotorDedicatedIn motorDedicatedInNumber)
Create a Digital Input from an Axis' Dedicated Input bits.
int32_t MaskGet()
Get the bit mask for the I/O point.
Represents one specific point: Digital Output, Digital Input, Analog Output, or Analog Input....
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...
void Abort()
Abort an axis.
int32_t MotionDoneWait()
Waits for a move to complete.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
RSIControllerAddressType
Used to get firmware address used in User Limits, Recorders, etc.
RSIEventType
Event Types or Status Bits.
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.