EXEC – Real-time executive

Block SymbolLicensing group: STANDARD
PIC

Function Description
The EXEC block is a cornerstone of the so-called project main file in the .mdl format, which configures individual subsystems of the REX control system. No similar block can be found in the Matlab-Simulink system. The EXEC block and all connected configuration blocks do not implement any mathematic algorithm. Such configuration structure is used by the RexComp compiler during building of the overall REX control system application.

The REX control system configuration consists of modules (Modules), input/output drivers (Drivers), archive subsystem (Archives) and real-time subsystem, which includes quick computation tasks (see the QTASK function block description for details) and four priority levels (Level0 to Level3) for inserting computation tasks (see the TASK function block description for details).

The base (shortest) period of the application is determined by the tick parameter. This value is checked by the RexComp compiler as its limits vary by selected target platform. Generally speaking, the lower period is used, the higher computational requirements of the REX Control System runtime core (RexCore) are.

The periods of individual computation levels (Level0 to Level3) are determined by multiplying the base period tick by the parameters ntick0 to ntick3. Parameters pri0 to pri3 are the logical priorities of corresponding computation levels in the REX control system. The REX control system uses 32 logical priorities, which are internally mapped to the target platform operating system dependent priorities. The highest logical priority of the REX control system is 0, the value 31 means the lowest. Should two tasks with different priorities run at the same time, the lower priority (higher value) task would be interrupted by the higher priority (lower value) task.

The default priorities pri0 to pri3 reflect the commonly accepted idea that the "fast" tasks (short sampling period) should have higher priority than the "slow" ones (the so-called Rate monotonic scheduling). This means that the default priorities need not to be changed in most cases. Impetuous changes can lead to unpredictable effects!

Outputs

Modules

Output for connecting the REX control system expansion modules, see the MODULE function block description for details

long

Drivers

Output for connecting the REX control system input/output drivers, see the IODRV and TIODRV function block descriptions for details

long

Archives

Output for archives configuration, see the ARC block

long

QTask

Output for connecting quick tasks with the highest priority and the shortest period, see the QTASK block

long

Level0

Computation level for inserting tasks (see the TASK block) with high priority pri0 and short period determined by the ntick0 parameter

long

Level1

Computation level for inserting tasks with medium priority pri1 and medium-length period determined by the ntick1 parameter

long

Level2

Computation level for inserting tasks with low priority pri2 and long period determined by the ntick2 parameter

long

Level3

Computation level for inserting tasks with the lowest priority pri3 and the longest period determined by the ntick3 parameter

long

Parameters

target

Target device  PC - Windows

string

Generic target device 

tick

The base period (tick) of the REX control system core and also the quick task (QTASK) period (in seconds)  0.05

double

ntick0

The multiplication tick*ntick0 determines the period of tasks connected to Level0   1 10

long

ntick1

The multiplication tick*ntick1 determines the period of tasks connected to Level1   ntick0+1 50

long

ntick2

The multiplication tick*ntick2 determines the period of tasks connected to Level2   ntick1+1 100

long

ntick3

The multiplication tick*ntick3 determines the period of tasks connected to Level3   ntick2+1 1200

long

pri0

Priority of all Level0 tasks   3  31 5

long

pri1

Priority of all Level1 tasks   pri0+1  31 9

long

pri2

Priority of all Level2 tasks   pri1+1  31 13

long

pri3

Priority of all Level3 tasks   pri2+1  31 18

long