I made a minimal working example that exhibits this behavior.
Here are the config pieces of code.
Configuring for ENTER REGION:
mc->UserLimitConditionSet(userlim,
0,
RSI::RapidCode::RSIUserLimitLogicGE,
actual_pos_host_addr,
pos_low_rmp);
mc->UserLimitConditionSet(userlim,
1,
RSI::RapidCode::RSIUserLimitLogicLE,
actual_pos_host_addr,
pos_high_rmp);
const double TRIGGER_IMMEDIATELY = 0.0;
const bool SINGLE_SHOT_EVENT = true;
mc->UserLimitConfigSet(userlim,
RSI::RapidCode::RSIUserLimitTriggerTypeCONDITION_AND,
RSI::RapidCode::RSIActionNONE, // don't do anything, just create an interrupt/event
TARGET_AXIS_IDX,
TRIGGER_IMMEDIATELY,
SINGLE_SHOT_EVENT);
Configuring for EXIT REGION:
mc->UserLimitConditionSet(userlim,
0,
RSI::RapidCode::RSIUserLimitLogicLT,
actual_pos_host_addr,
pos_low_rmp);
mc->UserLimitConditionSet(userlim,
1,
RSI::RapidCode::RSIUserLimitLogicGT,
actual_pos_host_addr,
pos_high_rmp);
const double TRIGGER_IMMEDIATELY = 0.0;
const bool SINGLE_SHOT_EVENT = true;
// int32 number, RSIUserLimitTriggerType triggerType, RSIAction action, int32 actionAxis, double duration, bool singleShot
mc->UserLimitConfigSet(userlim,
RSI::RapidCode::RSIUserLimitTriggerTypeCONDITION_OR,
RSI::RapidCode::RSIActionNONE, // don't do anything, just create an interrupt/event
TARGET_AXIS_IDX,
TRIGGER_IMMEDIATELY,
SINGLE_SHOT_EVENT);
When I run the program, it enters fine. As soon as I leave the region: loop!
Moving to start outside the region.
. Finished.
(->inside) UL 0: *(92871272) >= -1.31072e+06
AND
(->inside) UL 1: *(92871272) <= -655360
Curr: -400000
user limit configured.
.
Moving inside the region. (curr: -400000)
…User Limit #10 triggered! (2)
(->outside) UL 0: *(92871272) < -1.31072e+06
OR
(->outside) UL 1: *(92871272) > -655360
Curr: -657744
. Finished.
Moving outside the region. (curr: -799999)
…User Limit #10 triggered! (1)
(->inside) UL 0: *(92871272) >= -1.31072e+06
AND
(->inside) UL 1: *(92871272) <= -655360
Curr: -653403
User Limit #10 triggered! (2)
(->outside) UL 0: *(92871272) < -1.31072e+06
OR
(->outside) UL 1: *(92871272) > -655360
Curr: -651295
User Limit #10 triggered! (1)
(->inside) UL 0: *(92871272) >= -1.31072e+06
AND
(->inside) UL 1: *(92871272) <= -655360
Curr: -649509
…
(continues indefinitely)
I don’t know why I’m getting user limit events when I reconfigure it for re-entry. The current position clearly does not meet the (new) criteria for the user limit.
Can you help me figure out what’s going on here?