Metacommands are identifiers intended to condition the compilation phase. They do not directly generate any code but specify how the R3 source program is to be processed.
Metacommands are divided into four groups:
•defining the programming mode general time diagram
Metacommands for defining the programming mode general time diagram
$rule |
Definition of the Task 0 which contains the rules |
$task n |
Definition of the Task (1-:-8) |
$rule_periodic |
Definition of the periodic rule rule_periodic |
$rule_time |
|
$rule_inp |
Definition of the asynchronous rule int_inp |
Metacommands for conditioning the listing
Defines a symbol |
|
Removes the definition of a symbol |
|
If the symbol is defined, then the program is compiled |
|
If the symbol is not defined, then the program is compiled |
|
$expand |
If present, the expansion of LITs within the list file is handled at compile time |
Metacommands for general purposes
Includes an external file in the compilation (*.i3). Useful for symbolic definition of hardware resources |
||
$close_loop |
Simulates the closure of the position loop. If present, RTE simulates the cp and cv values of axes |
|
$check_array |
Checks, run-time, if there is an access to a nonexistent array element. Obviously penalizes run-time |
|
$write_on_extern |
Enables ability to write variables defined as extern (public) |
|
$use_rpe |
Enables extension to RPE (Robox Path Executor) language. Automatically added using the RDE project configurator (axes groups) |
|
$error "message" |
From RC3E v33.01.21 Forces compiler to give a compilation error (useful, e.g., within a conditional block, to notice whether or not the block is being compiled) |
|
$step |
To obtain the max performance of the interrupting rules, unnecessary instructions haven't been included. If you want to re-enable the step storage in a asynchronous rule task (including RULE_PERIODIC) to set breakpoints on their execution, you have to add at the beginning of the file (after the file type definition) the line $step Example:
|
|
$warning "messaggio" |
From RC3E v33.1.21 Forces the compiler to give a compile warning (useful, e.g., within a conditional block, to notice whether or not the block is being compiled) |
Pseudo instructions
Variables of type BIT_MASK allow the definition and initialization of particular integer variables (of type U32) to be used as bit masks.
Typically the setting of bits is done automatically through the configuration choices the user makes in the RDE project configurator.
However, variables of type BIT_MASK can also be read and modified from source file in R3.
bit_mask_set namevar value |
The variable namevar is initialized to value |
bit_mask_add namevar value |
In namevar the bits specified by value are set to 1, without altering the others |
bit_mask_remove namevar value |
In namevar the bits specified by value are set to 0, without altering the others |
NOTE: Even the lit instruction allows you to define symbolic to the variables.