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 REXYGEN 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 REXYGEN Compiler compiler during building of the overall REXYGEN control system application.

The REXYGEN 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 REXYGEN Compiler compiler as its limits vary by selected target platform. Generally speaking, the lower period is used, the higher computational requirements of the REXYGEN 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 REXYGEN system. The REXYGEN system uses 32 logical priorities, which are internally mapped to the target platform operating system dependent priorities. The highest logical priority of the REXYGEN 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!

In devices with multiple CPUs, it is possible to assign different levels to various CPUs. The assignment of CPUs is managed using the parameters cpu0 to cpu3. The CPUs are numbered starting from 0, where -1 denotes the default setting.

Outputs

Modules

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

Long (I32)

Drivers

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

Long (I32)

Archives

Output for archives configuration, see the ARC block

Long (I32)

QTask

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

Long (I32)

Level0

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

Long (I32)

Level1

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

Long (I32)

Level2

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

Long (I32)

Level3

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

Long (I32)

Parameters

target

Target device  Generic target device

String

Generic target device 

tick

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

Double (F64)

ntick0

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

Long (I32)

ntick1

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

Long (I32)

ntick2

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

Long (I32)

ntick3

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

Long (I32)

pri0

Priority of all Level0 tasks   3  31 5

Long (I32)

pri1

Priority of all Level1 tasks   pri0+1  31 9

Long (I32)

pri2

Priority of all Level2 tasks   pri1+1  31 13

Long (I32)

pri3

Priority of all Level3 tasks   pri2+1  31 18

Long (I32)

cpu0

Level0 tasks CPU core (-1=default, 0=core 0, 1=core 1, ...)   -1  127 -1

Long (I32)

cpu1

Level1 tasks CPU core (-1=default, 0=core 0, 1=core 1, ...)   -1  127 -1

Long (I32)

cpu2

Level2 tasks CPU core (-1=default, 0=core 0, 1=core 1, ...)   -1  127 -1

Long (I32)

cpu3

Level3 tasks CPU core (-1=default, 0=core 0, 1=core 1, ...)   -1  127 -1

Long (I32)

2023 © REX Controls s.r.o., www.rexygen.com