Console.WriteLine("š User Limit: Command Position Direct Set");
const int AXIS_COUNT = 1;
const int USER_LIMIT_FIRST = 0;
const int USER_LIMIT_SECOND = 1;
const int USER_LIMIT_COUNT = 2;
const int DURATION = 0;
const bool ONE_SHOT = true;
const int COMMAND_POSITION_INDEX = 0;
const int ACTUAL_POSITION_INDEX = 1;
try
{
Axis axis = controller.
AxisGet(Constants.AXIS_0_INDEX);
number: USER_LIMIT_FIRST,
conditionNumber: 0,
userLimitMask: 0x400000,
limitValueUInt32: 0x400000);
number: USER_LIMIT_FIRST,
duration: DURATION,
singleShot: ONE_SHOT);
number: USER_LIMIT_SECOND,
conditionNumber: 0,
userLimitMask: 1,
limitValueUInt32: 1);
number: USER_LIMIT_SECOND,
conditionNumber: 1,
limitValueDouble: 0.0);
number: USER_LIMIT_SECOND,
actionAxis: 0,
duration: 0,
singleShot: ONE_SHOT);
Console.WriteLine("Axis moving... waiting for user limit triggers");
ConfigureUserLimitInterrupts(controller, axis, USER_LIMIT_FIRST);
ConfigureUserLimitInterrupts(controller, axis, USER_LIMIT_SECOND);
WaitForInterrupts(controller);
Console.WriteLine("\nUser limit command position direct set complete.");
}
finally
{
}
{
number: userLimitIndex,
userDataIndex: COMMAND_POSITION_INDEX,
number: userLimitIndex,
userDataIndex: ACTUAL_POSITION_INDEX,
}
{
bool done = false;
int timeout_milliseconds = 100;
int interruptCount = 0;
while (!done)
{
{
interruptCount++;
Console.WriteLine($"\nInterrupt {interruptCount}: {eventType} at sample {controller.InterruptSampleTimeGet()}");
}
switch (eventType)
{
Console.WriteLine($" UserLimit: {userLimitNum}");
Console.WriteLine($" Command Position: {cmdPos}");
Console.WriteLine($" Actual Position: {actPos}");
break;
done = true;
Console.WriteLine($"\nā Completed - received {interruptCount} interrupts");
break;
default:
break;
}
}
}
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
static void PhantomAxisReset(Axis phantomAxis)
Configures a phantom axis on the controller.
Helpers class provides static methods for common tasks in RMP applications.
uint64_t AddressGet(RSIAxisAddressType addressType)
Get the an address for some location on the Axis.
void TriggeredModifyDecelerationSet(double decel)
Set the deceleration rate for an Triggered Modify Event.
void MoveVelocity(double velocity)
void TriggeredModifyJerkPercentSet(double jerkPct)
Set the jerk percent for an Triggered Modify Event.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
void UserLimitDisable(int32_t number)
Disable the processing of a User Limit.
void UserLimitConditionSet(int32_t number, int32_t conditionNumber, RSIUserLimitLogic logic, uint64_t addressOfUInt32, uint32_t userLimitMask, uint32_t limitValueUInt32)
Set the conditions for a User Limit with a 32-bit integer trigger value.
static MotionController * Get()
Get an already running RMP EtherCAT controller.
uint64_t AddressGet(RSIControllerAddressType type)
Get the an address for some location on the MotionController.
void UserLimitInterruptUserDataAddressSet(int32_t number, uint32_t userDataIndex, uint64_t address)
Set the User Data address based on a User Limit trigger.
void UserLimitConfigSet(int32_t number, RSIUserLimitTriggerType triggerType, RSIAction action, int32_t actionAxis, double duration, bool singleShot)
Configure a User Limit.
void Delete(void)
Delete the MotionController and all its objects.
void UserLimitCountSet(int32_t userLimitCount)
Set the number of processed UserLimits in the MotionController.
void InterruptEnableSet(bool enable)
Control interrupts for this class.
void AxisCountSet(int32_t axisCount)
Set the number of allocated and processed axes in the controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
double InterruptUserDataDoubleGet(uint32_t userDataIndex)
Get the user data associated with the interrupt, as a 64-bit double.
int32_t InterruptSourceNumberGet()
Get the number (or index) of the object (Axis, Motor, etc) that generated the interrupt.
RSIEventType InterruptWait(int32_t milliseconds)
Suspend the current thread until an interrupt arrives from the controller.
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
void Abort()
Abort an axis.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
int32_t NumberGet()
Get the axis number.
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.
@ RSIAxisAddressTypeCOMMAND_POSITION
Command Position.
@ RSIAxisAddressTypeACTUAL_POSITION
Actual Position.
RSIUserLimitTriggerType
Trigger types for UserLimits.