You can use the CoDeSys library: SysTask, which provides functions to create, change and get info of tasks.
PROGRAM PLC_PRG
VAR
hTask: SysTask.RTS_IEC_HANDLE; // task handle
udiInterval: UDINT; // intervall in micro seconds
END_VAR
// **** Implementation ***
// get handle of current task
SysTaskGetCurrent(ADR(hTask));
// get task interval
SysTaskGetInterval(hTask, udiInterval);
... View more