Validity: Rule, Task
This keyword gives access to the variable that contains the active rule number of the nth rule executor.
Syntax |
I32 rc (I32 n) |
---|---|
n |
Number of executor. Minimum representable number: 1 Maximum representable number: 32 |
Notes |
You can also use the keyword for direct assignment rc(n) = n. It is advisable to use the group instruction to ensure atomicity (when assigning multiple rc) |
If the number is negative, the rule executor is not enabled to execute (see order instruction).
Up to 1000 rules can be defined in the $rule (fixed frequency task) file. Each of these rules is represented by a number. The R3 language allows up to 32 of them to be sent to execution simultaneously via the group instruction. By means of the variable RC(n) the user can see what is, for example, the active rule for the indicated executor n (from 1 to 32). In practice then typically the user will associate n with the axis number.
Example
; the rule executor 13 will execute rule 15 rc(13) = 15 |
Example
; if the second rule executor is executing rule 23 ; then in sr(1) will be stored the string "I am in automatic" if(rc(2) = 23) sr(1) = "I am in automatic" endif |