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 TIMERINORDER_init__(TIMERINORDER *data__, BOOL retain) {
  __INIT_LOCATED(BOOL,__IX0_0,data__->NEXTSW,retain)
  __INIT_LOCATED_VALUE(data__->NEXTSW,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__IX0_1,data__->RESETSW,retain)
  __INIT_LOCATED_VALUE(data__->RESETSW,__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,__QX1_1,data__->TIMEOUT,retain)
  __INIT_LOCATED_VALUE(data__->TIMEOUT,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_0,data__->FIRST,retain)
  __INIT_LOCATED_VALUE(data__->FIRST,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_1,data__->SCDLY1,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_2,data__->SCDLY2,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY2,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_3,data__->SCDLY3,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY3,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX2_4,data__->SCDLY4,retain)
  __INIT_LOCATED_VALUE(data__->SCDLY4,__BOOL_LITERAL(FALSE))
  TON_init__(&data__->TON0,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 TIMERINORDER_body__(TIMERINORDER *data__) {
  // Initialise TEMP variables

  __SET_LOCATED(data__->,FIRST,,(((!(__GET_LOCATED(data__->ORDER4,)) && !(__GET_LOCATED(data__->ORDER3,))) && !(__GET_LOCATED(data__->ORDER2,))) && !(__GET_LOCATED(data__->ORDER1,))));
  __SET_VAR(data__->R_TRIG1.,CLK,,__GET_LOCATED(data__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG1);
  __SET_VAR(data__->R_TRIG2.,CLK,,__GET_LOCATED(data__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG2);
  __SET_LOCATED(data__->,ORDER1,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER2,))) && ((__GET_LOCATED(data__->ORDER1,) || (__GET_LOCATED(data__->FIRST,) && __GET_VAR(data__->R_TRIG1.Q,))) || ((!(__GET_LOCATED(data__->SCDLY4,)) && __GET_LOCATED(data__->ORDER4,)) && __GET_VAR(data__->R_TRIG2.Q,)))));
  __SET_VAR(data__->R_TRIG3.,CLK,,__GET_LOCATED(data__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG3);
  __SET_VAR(data__->R_TRIG4.,CLK,,__GET_LOCATED(data__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG4);
  __SET_VAR(data__->R_TRIG5.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER2,))) && ((__GET_LOCATED(data__->ORDER1,) || (__GET_LOCATED(data__->FIRST,) && __GET_VAR(data__->R_TRIG3.Q,))) || ((!(__GET_LOCATED(data__->SCDLY4,)) && __GET_LOCATED(data__->ORDER4,)) && __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__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG6);
  __SET_LOCATED(data__->,ORDER2,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER3,))) && (__GET_LOCATED(data__->ORDER2,) || ((!(__GET_LOCATED(data__->SCDLY1,)) && __GET_LOCATED(data__->ORDER1,)) && __GET_VAR(data__->R_TRIG6.Q,)))));
  __SET_VAR(data__->R_TRIG7.,CLK,,__GET_LOCATED(data__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG7);
  __SET_VAR(data__->R_TRIG8.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER3,))) && (__GET_LOCATED(data__->ORDER2,) || ((!(__GET_LOCATED(data__->SCDLY1,)) && __GET_LOCATED(data__->ORDER1,)) && __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__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG9);
  __SET_LOCATED(data__->,ORDER3,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER4,))) && (__GET_LOCATED(data__->ORDER3,) || ((!(__GET_LOCATED(data__->SCDLY2,)) && __GET_LOCATED(data__->ORDER2,)) && __GET_VAR(data__->R_TRIG9.Q,)))));
  __SET_VAR(data__->R_TRIG10.,CLK,,__GET_LOCATED(data__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG10);
  __SET_VAR(data__->R_TRIG11.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER4,))) && (__GET_LOCATED(data__->ORDER3,) || ((!(__GET_LOCATED(data__->SCDLY2,)) && __GET_LOCATED(data__->ORDER2,)) && __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__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG12);
  __SET_LOCATED(data__->,ORDER4,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER1,))) && (__GET_LOCATED(data__->ORDER4,) || ((!(__GET_LOCATED(data__->SCDLY3,)) && __GET_LOCATED(data__->ORDER3,)) && __GET_VAR(data__->R_TRIG12.Q,)))));
  __SET_VAR(data__->R_TRIG13.,CLK,,__GET_LOCATED(data__->TIMEOUT,));
  R_TRIG_body__(&data__->R_TRIG13);
  __SET_VAR(data__->R_TRIG14.,CLK,,((!(__GET_LOCATED(data__->RESETSW,)) && !(__GET_LOCATED(data__->ORDER1,))) && (__GET_LOCATED(data__->ORDER4,) || ((!(__GET_LOCATED(data__->SCDLY3,)) && __GET_LOCATED(data__->ORDER3,)) && __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__->TON0.,IN,,!(__GET_LOCATED(data__->TIMEOUT,)));
  __SET_VAR(data__->TON0.,PT,,__time_to_timespec(1, 0, 0.5, 0, 0, 0));
  TON_body__(&data__->TON0);
  __SET_LOCATED(data__->,TIMEOUT,,__GET_VAR(data__->TON0.Q,));

  goto __end;

__end:
  return;
} // TIMERINORDER_body__() 





