What are User Limits? User Limits are a functionality through which user can configure input comparisons which can trigger outputs and other SynqNet events. A User Limit will evaluate conditions set by the user. These conditions will be processed in the firmware of the SynqNet card. When these conditions are met, the User Limit will generate an interrupt and can also output 32-bit word to any location in the SynqNet firmware.
Each axis in the SynqNet controller has 16 User Limits available.
Each User Limit has two input conditions and one output configuration block.
When would I use User Limits?
Can you explain the RapidCode methods used for User Limits in detail? The main methods used for User Limits in RapidCode are: 1. UserLimitConditionSet (long number, long conditionNumber, long type, void * address, long mask, long limitValue) 2. UserLimitOutputSet (long number, long andMask, long orMask, long * outputPtr, long enabled) 3. UserLimitConfigSet (long number, long status, long logic, double duration) 4. UserLimitStateGet (long number)
In the next few pages we will discuss each one of them in detail.
Let’s discuss each method in detail. 1. UserLimitConditionSet (long number, long conditionNumber, long type, void * address, long mask, long limitValue)
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.
If user intends on tracking two input conditions, call the function twice using 0 for the first condition and 1 for the 2nd. Ex: user wants to monitor input bits of axis-2 & axis-3 position.
Ex: for a Digital Input Slice I/O, if the 4th bit is changing then the user would simply enter: 0x00010000.
Below are the enumerations for each input discussed above for the UserLimitConditionSet method:
long number: RSIEventTypeLIMIT_USER0 User Limit 0 RSIEventTypeLIMIT_USER1 User Limit 1 RSIEventTypeLIMIT_USER2 User Limit 2 RSIEventTypeLIMIT_USER3 User Limit 3 RSIEventTypeLIMIT_USER4 User Limit 4 RSIEventTypeLIMIT_USER5 User Limit 5 RSIEventTypeLIMIT_USER6 User Limit 6 RSIEventTypeLIMIT_USER7 User Limit 7 RSIEventTypeLIMIT_USER8 User Limit 8 RSIEventTypeLIMIT_USER9 User Limit 9 RSIEventTypeLIMIT_USER10 User Limit 10 RSIEventTypeLIMIT_USER11 User Limit 11 RSIEventTypeLIMIT_USER12 User Limit 12 RSIEventTypeLIMIT_USER13 User Limit 13 RSIEventTypeLIMIT_USER14 User Limit 14 RSIEventTypeLIMIT_USER15 User Limit 15
long type: RSIXmpLimitTypeFALSE False RSIXmpLimitTypeTRUE True RSIXmpLimitTypeGT Greater than RSIXmpLimitTypeGE Greater than or equal to RSIXmpLimitTypeLT Less than RSIXmpLimitTypeLE Less than or equal to RSIXmpLimitTypeEQ Equal RSIXmpLimitTypeBIT_CMP Bit comparison RSIXmpLimitTypeNE Not equal RSIXmpLimitTypeABS Absolute value RSIXmpLimitTypeABS_GT Greater than absolute value RSIXmpLimitTypeABS_LE Less than absolute value RSIXmpLimitTypeFGT Floating point greater than RSIXmpLimitTypeFGE Floating point greater than or equal to RSIXmpLimitTypeFLT Floating point less than RSIXmpLimitTypeFLE Floating point less than or equal to RSIXmpLimitTypeFEQ Floating point equal RSIXmpLimitTypeFNE Floating point not equal RSIXmpLimitTypeFABS Floating point absolute value RSIXmpLimitTypeFABS_GT Floating point greater than absolute value RSIXmpLimitTypeFABS_LE Floating point less than absolute value
void *address: RSIAxisAddressTypeACTUAL_POSITION, Actual Position RSIAxisAddressTypeCOMMAND_POSITION, Command Position RSIAxisAddressTypePOSITION_ERROR, Position Error RSIAxisAddressTypeACTUAL_VELOCITY, Actual Velocity RSIAxisAddressTypeCOMMAND_VELOCITY, Command Velocity RSIAxisAddressTypeCOMMAND_ACCELERATION, Command Acceleration RSIAxisAddressTypeSTATUS, Axis Status RSIAxisAddressTypeMOTION_STATUS, Motion Status RSIAxisAddressTypeDEMAND, Filter Output RSIAxisAddressTypeDIGITAL_OUTPUTS, Digital Output RSIAxisAddressTypeDIGITAL_INPUTS, Digital Input
To track more complex input bit addresses. User can get the address from vm3 or contact us.
2. UserLimitOutputSet (long number, long andMask, long orMask, long * outputPtr, long enabled)
This method allows the user to configure the output to be triggered. The output will only be triggered if the input conditions are TRUE.
3. UserLimitConfigSet (long number, long status, long logic, double duration)
This method configures a User Limit. Please read individual inputs in the method to understand this method better.
Ex: If user enters RSIXmpStatusLIMIT, method will only compute the andMask and orMask on the outputPtr, no action will occur on the axis.
Ex: If both conditions need to be true then RSIXmpLogicAND can be used. Enumerations are provided below.
Ex: If only one condition is kept track of then RSIXmpLogicSINGLE is entered.
Ex: This really helps the users where systems temporarily change the state of an input condition due to noise spikes.
long status: RSIXmpStatusSTOP STOP RSIXmpStatusESTOP E-STOP RSIXmpStatusESTOP_ABORT E-STOP then ABORT RSIXmpStatusESTOP_CMD_EQ_ACT E-STOP then set Command = Actual RSIXmpStatusABORT ABORT RSIXmpStatusLIMIT Limit
long logic: RSIXmpLogicNEVER Never evaluate RSIXmpLogicSINGLE Evaluate first condition RSIXmpLogicDOUBLE Not used. RSIXmpLogicTYPE_MASK Type Mask RSIXmpLogicOR OR conditions RSIXmpLogicAND AND conditions
Can you explain the AND & OR mask used in the User Limits methods? As mentioned above, AND Mask is executed before OR Mask. Basically andMask is AND-ed to outputPtr and then orMask is OR-ed to the result of (andMask and outputPtr).
Truth table for AND Gate:
Truth table for OR Gate:
An example for user using User Limits:
Sample Applications for User Limits:
User limits trigger events only when the limit changes state from FALSE to TRUE. In other words a user limit must be reset by changing its state to FALSE before it can trigger another event.
User Limit Number to operate with. This should be of the UserLimit types within the RSIEventType Enumeration.