The code for a basic Task that contains activities A11 and A12 will resemble the following:
If the Task is periodic, with a period of 10 ticks, the code will resemble the following:
if ((cgGlobalFlags & ALARM_SET_TASK1) == 0){
cgGlobalFlags |= ALARM_SET_TASK1;
SetRelAlarm(TASK1_ALARM, 10, 10);
The code for a periodic Task, containing activities A11 and A12 with CTRL1 as a controller, will resemble the following:
if ((cgGlobalFlags & ALARM_SET_TASK1) == 0){
cgGlobalFlags |= ALARM_SET_TASK1;
SetAbsAlarm(TASK1_ALARM, 10, 10);
cgGlobalFlags &= ~BITSUPERSTEP_TASK3;