void LOGGER_init__(LOGGER *data__, BOOL retain) {
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
  __INIT_VAR(data__->TRIG,__BOOL_LITERAL(FALSE),retain)
  __INIT_VAR(data__->MSG,__STRING_LITERAL(0,""),retain)
  __INIT_VAR(data__->LEVEL,LOGLEVEL__INFO,retain)
  __INIT_VAR(data__->TRIG0,__BOOL_LITERAL(FALSE),retain)
}

// Code part
void LOGGER_body__(LOGGER *data__) {
  // Control execution
  if (!__GET_VAR(data__->EN)) {
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
    return;
  }
  else {
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
  }
  // Initialise TEMP variables

  if ((__GET_VAR(data__->TRIG,) && !(__GET_VAR(data__->TRIG0,)))) {
    #define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
    #define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)

   LogMessage(GetFbVar(LEVEL),(char*)GetFbVar(MSG, .body),GetFbVar(MSG, .len));
  
    #undef GetFbVar
    #undef SetFbVar
;
  };
  __SET_VAR(data__->,TRIG0,,__GET_VAR(data__->TRIG,));

  goto __end;

__end:
  return;
} // LOGGER_body__() 





void ASYNCHRO2_init__(ASYNCHRO2 *data__, BOOL retain) {
  __INIT_LOCATED(BOOL,__IX0_0,data__->RESETSW,retain)
  __INIT_LOCATED_VALUE(data__->RESETSW,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__IX0_1,data__->NEXTSW,retain)
  __INIT_LOCATED_VALUE(data__->NEXTSW,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_0,data__->ORDER1,retain)
  __INIT_LOCATED_VALUE(data__->ORDER1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_1,data__->ORDER2,retain)
  __INIT_LOCATED_VALUE(data__->ORDER2,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_2,data__->ORDER3,retain)
  __INIT_LOCATED_VALUE(data__->ORDER3,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_3,data__->ORDER4,retain)
  __INIT_LOCATED_VALUE(data__->ORDER4,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_4,data__->SORDER1,retain)
  __INIT_LOCATED_VALUE(data__->SORDER1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_5,data__->SORDER2,retain)
  __INIT_LOCATED_VALUE(data__->SORDER2,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_6,data__->SORDER3,retain)
  __INIT_LOCATED_VALUE(data__->SORDER3,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_7,data__->SORDER4,retain)
  __INIT_LOCATED_VALUE(data__->SORDER4,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX1_1,data__->TOGOUT0,retain)
  __INIT_LOCATED_VALUE(data__->TOGOUT0,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_0,data__->TIMEUP1,retain)
  __INIT_LOCATED_VALUE(data__->TIMEUP1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_1,data__->TIMEUP2,retain)
  __INIT_LOCATED_VALUE(data__->TIMEUP2,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_2,data__->TIMEUP3,retain)
  __INIT_LOCATED_VALUE(data__->TIMEUP3,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_3,data__->TIMEUP4,retain)
  __INIT_LOCATED_VALUE(data__->TIMEUP4,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_4,data__->NOORDER1,retain)
  __INIT_LOCATED_VALUE(data__->NOORDER1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_5,data__->FIRST,retain)
  __INIT_LOCATED_VALUE(data__->FIRST,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_6,data__->SCDLY1,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_7,data__->SCDLY2,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY2,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX3_0,data__->SCDLY3,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY3,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX3_1,data__->SCDLY4,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY4,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX3_2,data__->TMOUT,retain)
  __INIT_LOCATED_VALUE(data__->TMOUT,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX3_3,data__->RST0,retain)
  __INIT_LOCATED_VALUE(data__->RST0,__BOOL_LITERAL(FALSE))
  TON_init__(&data__->TON0,retain);
  TON_init__(&data__->TON1,retain);
  TON_init__(&data__->TON2,retain);
  TON_init__(&data__->TON3,retain);
  TON_init__(&data__->TON4,retain);
  R_TRIG_init__(&data__->R_TRIG1,retain);
  R_TRIG_init__(&data__->R_TRIG2,retain);
  R_TRIG_init__(&data__->R_TRIG3,retain);
  R_TRIG_init__(&data__->R_TRIG4,retain);
  R_TRIG_init__(&data__->R_TRIG5,retain);
  R_TRIG_init__(&data__->R_TRIG6,retain);
  R_TRIG_init__(&data__->R_TRIG7,retain);
  R_TRIG_init__(&data__->R_TRIG8,retain);
  R_TRIG_init__(&data__->R_TRIG9,retain);
  R_TRIG_init__(&data__->R_TRIG10,retain);
  R_TRIG_init__(&data__->R_TRIG11,retain);
  R_TRIG_init__(&data__->R_TRIG12,retain);
  R_TRIG_init__(&data__->R_TRIG13,retain);
  R_TRIG_init__(&data__->R_TRIG14,retain);
}

// Code part
void ASYNCHRO2_body__(ASYNCHRO2 *data__) {
  // Initialise TEMP variables

  __SET_LOCATED(data__->,NOORDER1,,(((!(__GET_LOCATED(data__->ORDER4,)) && !(__GET_LOCATED(data__->ORDER3,))) && !(__GET_LOCATED(data__->ORDER2,))) && !(__GET_LOCATED(data__->ORDER1,))));
  __SET_LOCATED(data__->,ORDER1,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP1,))) && ((__GET_LOCATED(data__->NOORDER1,) || __GET_LOCATED(data__->ORDER1,)) || __GET_LOCATED(data__->TIMEUP4,))));
  __SET_VAR(data__->TON0.,IN,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP1,))) && ((__GET_LOCATED(data__->NOORDER1,) || __GET_LOCATED(data__->ORDER1,)) || __GET_LOCATED(data__->TIMEUP4,))));
  __SET_VAR(data__->TON0.,PT,,__time_to_timespec(1, 0, 1, 0, 0, 0));
  TON_body__(&data__->TON0);
  __SET_LOCATED(data__->,TIMEUP1,,__GET_VAR(data__->TON0.Q,));
  __SET_LOCATED(data__->,ORDER2,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP2,))) && (__GET_LOCATED(data__->ORDER2,) || __GET_LOCATED(data__->TIMEUP1,))));
  __SET_VAR(data__->TON1.,IN,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP2,))) && (__GET_LOCATED(data__->ORDER2,) || __GET_LOCATED(data__->TIMEUP1,))));
  __SET_VAR(data__->TON1.,PT,,__time_to_timespec(1, 0, 0.7, 0, 0, 0));
  TON_body__(&data__->TON1);
  __SET_LOCATED(data__->,TIMEUP2,,__GET_VAR(data__->TON1.Q,));
  __SET_LOCATED(data__->,ORDER3,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP3,))) && (__GET_LOCATED(data__->ORDER3,) || __GET_LOCATED(data__->TIMEUP2,))));
  __SET_VAR(data__->TON2.,IN,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP3,))) && (__GET_LOCATED(data__->ORDER3,) || __GET_LOCATED(data__->TIMEUP2,))));
  __SET_VAR(data__->TON2.,PT,,__time_to_timespec(1, 0, 0.5, 0, 0, 0));
  TON_body__(&data__->TON2);
  __SET_LOCATED(data__->,TIMEUP3,,__GET_VAR(data__->TON2.Q,));
  __SET_LOCATED(data__->,ORDER4,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP4,))) && (__GET_LOCATED(data__->ORDER4,) || __GET_LOCATED(data__->TIMEUP3,))));
  __SET_VAR(data__->TON3.,IN,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TIMEUP4,))) && (__GET_LOCATED(data__->ORDER4,) || __GET_LOCATED(data__->TIMEUP3,))));
  __SET_VAR(data__->TON3.,PT,,__time_to_timespec(1, 0, 1.7, 0, 0, 0));
  TON_body__(&data__->TON3);
  __SET_LOCATED(data__->,TIMEUP4,,__GET_VAR(data__->TON3.Q,));
  __SET_LOCATED(data__->,FIRST,,(((!(__GET_LOCATED(data__->SORDER4,)) && !(__GET_LOCATED(data__->SORDER3,))) && !(__GET_LOCATED(data__->SORDER2,))) && !(__GET_LOCATED(data__->SORDER1,))));
  __SET_VAR(data__->R_TRIG1.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG1);
  __SET_VAR(data__->R_TRIG2.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG2);
  __SET_LOCATED(data__->,SORDER1,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER2,))) && ((__GET_LOCATED(data__->SORDER1,) || (__GET_LOCATED(data__->FIRST,) && __GET_VAR(data__->R_TRIG1.Q,))) || ((!(__GET_LOCATED(data__->SCDLY4,)) && __GET_LOCATED(data__->SORDER4,)) && __GET_VAR(data__->R_TRIG2.Q,)))));
  __SET_VAR(data__->R_TRIG3.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG3);
  __SET_VAR(data__->R_TRIG4.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG4);
  __SET_VAR(data__->R_TRIG5.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER2,))) && ((__GET_LOCATED(data__->SORDER1,) || (__GET_LOCATED(data__->FIRST,) && __GET_VAR(data__->R_TRIG3.Q,))) || ((!(__GET_LOCATED(data__->SCDLY4,)) && __GET_LOCATED(data__->SORDER4,)) && __GET_VAR(data__->R_TRIG4.Q,)))));
  R_TRIG_body__(&data__->R_TRIG5);
  __SET_LOCATED(data__->,SCDLY1,,__GET_VAR(data__->R_TRIG5.Q,));
  __SET_VAR(data__->R_TRIG6.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG6);
  __SET_LOCATED(data__->,SORDER2,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER3,))) && (__GET_LOCATED(data__->SORDER2,) || ((!(__GET_LOCATED(data__->SCDLY1,)) && __GET_LOCATED(data__->SORDER1,)) && __GET_VAR(data__->R_TRIG6.Q,)))));
  __SET_VAR(data__->R_TRIG7.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG7);
  __SET_VAR(data__->R_TRIG8.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER3,))) && (__GET_LOCATED(data__->SORDER2,) || ((!(__GET_LOCATED(data__->SCDLY1,)) && __GET_LOCATED(data__->SORDER1,)) && __GET_VAR(data__->R_TRIG7.Q,)))));
  R_TRIG_body__(&data__->R_TRIG8);
  __SET_LOCATED(data__->,SCDLY2,,__GET_VAR(data__->R_TRIG8.Q,));
  __SET_VAR(data__->R_TRIG9.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG9);
  __SET_LOCATED(data__->,SORDER3,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER4,))) && (__GET_LOCATED(data__->SORDER3,) || ((!(__GET_LOCATED(data__->SCDLY2,)) && __GET_LOCATED(data__->SORDER2,)) && __GET_VAR(data__->R_TRIG9.Q,)))));
  __SET_VAR(data__->R_TRIG10.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG10);
  __SET_VAR(data__->R_TRIG11.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER4,))) && (__GET_LOCATED(data__->SORDER3,) || ((!(__GET_LOCATED(data__->SCDLY2,)) && __GET_LOCATED(data__->SORDER2,)) && __GET_VAR(data__->R_TRIG10.Q,)))));
  R_TRIG_body__(&data__->R_TRIG11);
  __SET_LOCATED(data__->,SCDLY3,,__GET_VAR(data__->R_TRIG11.Q,));
  __SET_VAR(data__->R_TRIG12.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG12);
  __SET_LOCATED(data__->,SORDER4,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER1,))) && (__GET_LOCATED(data__->SORDER4,) || ((!(__GET_LOCATED(data__->SCDLY3,)) && __GET_LOCATED(data__->SORDER3,)) && __GET_VAR(data__->R_TRIG12.Q,)))));
  __SET_VAR(data__->R_TRIG13.,CLK,,__GET_LOCATED(data__->NEXTSW,));
  R_TRIG_body__(&data__->R_TRIG13);
  __SET_VAR(data__->R_TRIG14.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->SORDER1,))) && (__GET_LOCATED(data__->SORDER4,) || ((!(__GET_LOCATED(data__->SCDLY3,)) && __GET_LOCATED(data__->SORDER3,)) && __GET_VAR(data__->R_TRIG13.Q,)))));
  R_TRIG_body__(&data__->R_TRIG14);
  __SET_LOCATED(data__->,SCDLY4,,__GET_VAR(data__->R_TRIG14.Q,));
  __SET_VAR(data__->TON4.,IN,,(!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->TMOUT,))));
  __SET_VAR(data__->TON4.,PT,,__time_to_timespec(1, 300, 0, 0, 0, 0));
  TON_body__(&data__->TON4);
  __SET_LOCATED(data__->,TMOUT,,__GET_VAR(data__->TON4.Q,));
  __SET_LOCATED(data__->,RST0,,(__GET_LOCATED(data__->TOGOUT0,) && __GET_LOCATED(data__->TMOUT,)));
  __SET_LOCATED(data__->,TOGOUT0,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->RST0,))) && (__GET_LOCATED(data__->TMOUT,) || __GET_LOCATED(data__->TOGOUT0,))));

  goto __end;

__end:
  return;
} // ASYNCHRO2_body__() 





