User Limits are a functionality through which user can configure a comparison between inputs, so when the comparison happens an output or an interrupt can be triggered.
A User Limit will evaluate conditions set by the user. These conditions will be processed in the firmware of the RMP. When these conditions are met, the User Limit will generate an interrupt and can also output 32-bit word to any location in the MotionController firmware.
Each User Limit supports up to two input conditions and one output configuration block.
When to Use User Limits?
User Limits are best suited for real-time logic processing that must happen in RMP firmware, not the user application.
When you want to generate an action based on a digital input state change.
When you want to generate an action based on two different input state changes.
When you want to generate an action based on a specific encoder/axis position.
When you want to trigger a digital output when an Axis’ Actual Position is exceeded.
Enter the user limit number that will be used. Starts from 0 and goes to (UserLimitCountGet – 1).
Enter 0 or 1 to define the number of input conditions to be processed. Maximum of two input conditions can be combined with AND or OR logic. ConditionNumber would be set to 0 to compare one input bit. ConditionNumber would be set to 1 to compare two input bits.
Represents logic that user will need to select to select how an input value is compared. See Enumerations below for valid options. Ex: user wants to compare an actual position to see when actual position is greater than 2000 counts. User would have to enter RSIUserLimitLogicGT
User needs to enter the address of the input. User can call Axis.AddressGet(), MotionController.AddressGet(), or MotionController.NetworkInputAddressGet() to get the address of a particular input.
Decide the bits in an address which need to be used when comparing. Use 0xFFFFFFFF when all bits should be considered. (* only applicable when the Condition’s DataType is a 32-bit integer or bitmask)
The value to be compared which needs to be set here.
This method should be called first. UserLimitConditionSet() configures user limits to evaluate an input bit. It sets a condition for when the user limit should trigger.
To track more complex input bit addresses, user can get the address from VM3 or contact us.
A user wants to compare the input condition of only a single axis position. If user intends on tracking two input conditions, call the function twice using 0 for the first condition and 1 for the 2nd condition.
If the user wants the User Limit to trigger when axis-0 position is greater than 2000 counts, then 2000 would be the limitValue.
For a Digital Input Slice I/O, if the 4th bit is changing then the user would simply enter: 0x00010000.
Enter the user limit number that you want to configure to trigger an output. Starts from 0 and goes to (UserLimitCountGet – 1).
This is a 32-bit AND mask. andMask is always computed before orMask. Bit mask will be AND-ed with the data pointed by the ulong outputPtr.
This is a 32-bit OR mask. Bit mask will be OR-ed with the result of (andMask & outputPtr).
Pointer to any location in the motion controller firmware. This is a host address, like the values returned from AddressGet(...) methods.
If TRUE, the output AND-ing and OR-ing will be executed when the User Limit triggers.
Call this method after UserLimitConfigSet(), but only if you want to configure an output to be triggered. The output will only be triggered when the User Limit is triggered.
Other User Limit Info
It is important to know that our API reserves a user limit per every one axis.
The RMP controller has up to 2048 User Limit objects.
UserLimitCountSet should be done after either setting AxisCountSet and/or starting the network. (Internally, RapidCode Axis objects use UserLimits.) UserLimitCountSet must be called before creating an Axis or MultiAxis object with MotionController::AxisGet() or MotionController::MultiAxisGet().
User Limits are “zero” ordinate when accessing them.
Are User Limits monitored cyclically like PLC?
Yes, User Limit objects are running inside the real-time motion firmware and they are cyclic (processed every cycle).