TASK – Standard task of the REXYGEN system

Block SymbolLicensing group: STANDARD
PIC

Function Description
The overall control algorithm of the REXYGEN system consists of individual tasks. These are included by using the TASK block. There can be one or more tasks in the control algorithm. The REXYGEN system contains four main computational levels represented by the Level0 to Level3 outputs of the EXEC block. The individual tasks are added to the given computational level <i> by connecting the prev input with the corresponding Level<i> output or with the next output of a TASK, which is already included in the given level <i>. There can be only one task connected to the next output of the TASK block. The next output of the last task in the given level remains unconnected. This means that the tasks in one level create a unidirectional chain which defines the order of initialization and execution of the individual tasks of the given level in the REXYGEN system. The individual levels are ordered from Level0 to Level3 (the QTASK block precedes Level0).

All tasks at the given level <i> are executed with the same priority, which is determined by the pri<i> parameter of the EXEC block. The execution period of the task is calculated as a multiple of the factor parameter and the base tick of the ntick<i>tick in the EXEC block.

The time allocated for task execution starts at the start tick and ends at the stop tick. The start and stop values can be fixed or left to be controlled by the RexCore. For RexCore control, the parameters can be filled in as follows:

  • start = -1: The execution begins as soon as the previous Task ends.
  • start = -2: The execution starts on the next tick after the completion of the previous task.
  • stop = -1: The task execution must finish before the end of ntick<i>*tick.
  • stop = -2: The task execution must finish in the next tick.

For fixed execution times, start and stop should be a non-negative integer.

The REXYGEN Compiler compiler additionally verifies that the stop parameter of the preceding task is less than or equal to the stop parameter of the succeeding task. This ensures that the allocated time intervals for individual tasks do not overlap. If the timing of individual levels is inappropriate, tasks may be interrupted by tasks and other events with higher priority. In such cases, execution is not aborted but delayed (in contrast to the QTASK block). The Diagnostics section of the REXYGEN Studio program assesses whether the execution delay is occasional or permanent (the Level and Task tabs).

Input

prev

Input for connecting the task with the corresponding Level<i> output of the EXEC block or with the next output of the preceding task of the given level

Long (I32)

Output

next

Output for connecting to the prev input of the succeeding task in the given level

Long (I32)

Parameters

factor

Execution factor; multiple of the execution period of the i-th level of the EXEC block defining the execution period of the task: factortickntick<i>  1

Long (I32)

start

Number of tick of the given computational level which should trigger the task execution   0  ntick<i> 0

Long (I32)

stop

Number of tick of the given computational level by which the task execution should finish   start+1  ntick<i> 1

Long (I32)

stack

Stack size [bytes]  10240

Long (I32)

filename

Name of the file with the .mdl extension which contains the task algorithm. In the case filename is not specified, the filename is given by the name of the TASK block in the project main file (the .mdl extension is attached automatically)

String

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