Using dT

An RTA-OSEK operating system is implemented for the ES910 and RTPRO-PC target. The operating system enables access to the time dT which has elapsed between the last and second last call of the running task. dT always refers to the task in which the variable is used.

dT is a global uint32 variable. It is declared in one of the RTA-OSEK header files and contains the value for the current task in units of system ticks.

dT can be accessed from ASCET using the dT button in the editors. This enables you to create an element (real64) which contains the time in units of seconds. If users do not generate this element in the C code editor, but still accesses dT, no error message appears because dT is declared in the RTA-OSEK files. But as dT in RTA-OSEK and dT in ASCET have different units (system ticks or seconds respectively), the calculations are incorrect. You should therefore ensure that you generate the corresponding element with the dT button.

In the generated code for experimental targets, access to the global element dT is indirect: A C code macro is generated to access dT. The name of the macro is created as follows:

_<PROJECTNAME>_<IMPLEMENTATION>_dTAccess

A default definition of the macro is generated by ASCET which can be replaced by a user-defined definition.