Please enable JavaScript to view this site.

Introduction

RTE is a multitasking operating system.

Bookmarks

Tasks time diagram

scheduler_generale

Managed tasks

Type of task

Priority

Description

Background task (Time-sharing)

7

These are 8 tasks written in R3 language with low priority to be used for performing non-time-critical functions (e.g., machine logic management).

Task 1 ($TASK1) represents the entry point of the program. It will then be the task of this same task to enable/disable the handling of the others (see instructions mt_en and mt_dis).

NOTE: The typical architecture of these tasks consists of an initialization phase followed by an infinite loop within which the various managements of the controlled machine are executed.

The proper evolution of these tasks is performed by RTE. In case of anomalies, alarm '9113 User Task(t.s.): reduced freq. <Tname>' is generated.

Information about duration and frequency is left to the programmer (loop_time). Through the device commands ts_per_override and ts_nst_override the default execution settings can be displayed/overridden

Low priority ladder

6

Task Ladder whose execution frequency is decided by the user (1Hz÷2000Hz).

Its duration can be viewed through the predefined variable ltl_length

OB service

5

 

Rule_periodic

4

Particular RULE that is executed at a frequency set by the user.

Having lower priority than the RULES, the execution period is subject to jitter, the maximum duration of which will be equal to the time it takes RTE to execute the higher priority tasks (RULE + SYNCHRONOUS TASK LADDER + HIGH PRIORITY TASK LADDER + possible TASK ON EVENT)

Normal priority ladder

3

Task written in Ladder language whose execution frequency is decided by the user (1Hz÷2000Hz).

Its duration can be viewed through the predefined variable ltn_length

RULES (fixed frequency functions, interrupts)

 

RULE_INIT

2

These are Tasks written in R3 language reserved for the construction of trajectories, the description of the existing links between the various axes and the possible execution of the feedback algorithm (loop closure).

RTE is capable of simultaneously executing up to 32 RULES (RC) in the system interrupt.

The selection of RULES to be executed is done through the group instruction, while the order of execution can be imposed through the order instruction.

 

Its duration can be viewed through the predefined variable rule_length.

 

The rule_init is a particular RULE that is executed once before the RULES are executed.

It is executed the first time the order or group instruction is invoked.

NOTE: Until the program executes the group instruction for the first time or the predefined variable rc is imposed no RULE is active.

NOTE: If you want to activate rule_init for example to activate rule_prologue or epilogue even if no rules are active, use the keyword rule_start_norc

Synchronous ladder

2

It is a task written in Ladder language that is executed (if present) along with RULES.

Its duration can be viewed through the predefined variable lts_length

Task on event

1

These are particular tasks written in R3 language having the highest system priority and to be used to solve particular needs.

Enabling events are:

Change front of a digital input(int_inp)

Frequency set(int_timer)

Expiration of a specified time from the occurrence of a condition(int_after)

NOTE: Any operation being performed by RTE is interrupted to handle these events. (Typical latency can be estimated at 40us). Consequently, we remember that inordinate use of this performance may cause degradation of normal system performance. Users are urged to use the performance wisely to avoid addiction!

High priority ladder

1

It is a task written in Ladder language whose execution period is decided by the user (1Hz÷2000Hz).

Its duration can be viewed through the predefined variable lth_length.

Note: Any operation being performed by RTE is interrupted to handle these events. (Typical latency can be estimated at 40us). Consequently, we remember that inordinate use of this performance can cause degradation of normal system performance. Users are urged to use the performance wisely to avoid addiction!

Time rules diagram

scheduler_rule

Function

Description

OB hooking 1

Object Block tracking hook1

REF_PROLOGUE

Optional function that, if defined, is executed first when the system interrupt occurs (being executed first is the function with less gitter than the sample interval SI)

REF

Depending on the active RULES, for the axes defined in them, all fields REF END_REF are executed in order to generate the drive reference (result of the position loop).

RPE

Axes group management entrusted to RPE with "before rule" selection

OB hooking 2

Object Block tracking hook2

RULE_PROLOGUE

Optional function that, if defined, is executed immediately after the REF fields

MOTION, AUX

MOTION: Generation of new axis kinematic variables (IP or IV or IA).

AUX: Execution of time-critical code but not involving axes (optional).

The division between MOTION and AUX is only conceptual and is used by particularly neat and finicky programmers

RULE_EPILOGUE

Optional function that, if defined, is executed immediately after the MOTION AUX fields

LADDER SINCRONO

SYNCHRONOUS LADDER TASK. Use the LAD_STATUS command to get information about execution timing

RPE

Axes group management given to RPE with "after rules" selection

OB hooking 3

Object block tracking hook3

Timesharing management

The execution time of tasks is decided by RTE and is divided appropriately.

R3 task switching is done by RTE considering 2 variables: Minimum execution time and Minimum number of steps.

If at the end of the minimum execution time the minimum number of steps has not been done, RTE waits for the minimum number of steps to be done before changing tasks.

NOTE: In case of DWELL or MT_WAIT instruction calls, the task change is done immediately.

Since RTE 34.23.2 some OB functions can also be executed in timesharing. The change of OB functions is done by RTE considering only the minimum execution time.

If more than one OB function is present, RTE will execute up to 4 OB functions per time "slot," up to a maximum of 128 OB functions (see examples 3,4,6,7).

From RTE 34.23.2 it is also possible to define up to 4 priority levels. In this case RTE will use 4 different strategies depending on the number of levels defined.

NOTE: RTE checks run time the correct evolution of the tasks, giving alarms (9100 etc...) and removing power to the Power Set if necessary.

Strategy

Number of priority levels

Sequence of execution

Time available to execute tasks. Each task has its own time (Tt).

Strategy 1: One priority level present

Ex. Priority 4 (default, lowest priority)

P4

Each task (with priority 4) will be executed for time Tt.

See examples 1-:-4

Strategy 2: Two priority levels present

Ex. Priority 4 and Priority 2 (P4,P2)

P2 P4 P2 P4 P2

Each task with priority 4 will be executed for time Tt/2.

Each task with priority 2 will be executed for time Tt/3.

See examples 5-:-7

Strategy 3: Three levels of priority present

Ex. Priority 4, Priority 2 and Priority 1 (P4, P2, P1)

P1 P2 P4 P1 P2 P1 P4 P2 P1

Each task with priority 4 will be executed for time Tt/2

Each task with priority 2 will be executed for time Tt/3

Each task with priority 1 will be executed for time Tt/4

Strategy 4: Four priority levels present

Ex. Priority 4, Priority 3, Priority 2 and Priority 1 (P4,P3,P2,P1)

P1 P2 P3 P1 P2 P3 P2 P1 P4

Each task with priority 4 will be executed for time Tt

Each task with priority 3 will be executed for time Tt/2

Each task with priority 2 will be executed for time Tt/3

Each task with priority 1 will be executed for time Tt/4

See example 8

In practice, increasing the priority of a task leads to the task being executed more frequently, but for less time.

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Timesharing device commands

TS_INFO

Allows you to display information about the status of tasks managed in timesharing

TS_NST_OVERRIDE

Allows you to set the minimum number of steps reserved for timesharing tasks

TS_PER_OVERRIDE

Allows to set the minimum number of execution time reserved for tasks in timesharing

TS_PRIO

Allows you to set the execution priority of tasks in timesharing

Predefined variables timesharing

SYS_FLAG.29

Enables dump of task change messages in timesharing

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC