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 COUNTERTEST1_init__(COUNTERTEST1 *data__, BOOL retain) {
  __INIT_LOCATED(BOOL,__IX0_0,data__->TRIG1,retain)
  __INIT_LOCATED_VALUE(data__->TRIG1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__IX0_1,data__->RESET,retain)
  __INIT_LOCATED_VALUE(data__->RESET,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__IX0_2,data__->TRIG2,retain)
  __INIT_LOCATED_VALUE(data__->TRIG2,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__IX0_3,data__->LOAD,retain)
  __INIT_LOCATED_VALUE(data__->LOAD,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_0,data__->CTOVER1,retain)
  __INIT_LOCATED_VALUE(data__->CTOVER1,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX0_1,data__->CTOVER2,retain)
  __INIT_LOCATED_VALUE(data__->CTOVER2,__BOOL_LITERAL(FALSE))
  __INIT_LOCATED(BOOL,__QX1_2,data__->ALWAYSON,retain)
  __INIT_LOCATED_VALUE(data__->ALWAYSON,__BOOL_LITERAL(FALSE))
  CTU_init__(&data__->CTU0,retain);
  CTD_init__(&data__->CTD0,retain);
  R_TRIG_init__(&data__->R_TRIG1,retain);
  R_TRIG_init__(&data__->R_TRIG2,retain);
}

// Code part
void COUNTERTEST1_body__(COUNTERTEST1 *data__) {
  // Initialise TEMP variables

  __SET_VAR(data__->R_TRIG1.,CLK,,__GET_LOCATED(data__->TRIG1,));
  R_TRIG_body__(&data__->R_TRIG1);
  __SET_VAR(data__->CTU0.,CU,,__GET_VAR(data__->R_TRIG1.Q,));
  __SET_VAR(data__->CTU0.,R,,__GET_LOCATED(data__->RESET,));
  __SET_VAR(data__->CTU0.,PV,,5);
  CTU_body__(&data__->CTU0);
  __SET_LOCATED(data__->,CTOVER1,,__GET_VAR(data__->CTU0.Q,));
  __SET_VAR(data__->R_TRIG2.,CLK,,__GET_LOCATED(data__->TRIG2,));
  R_TRIG_body__(&data__->R_TRIG2);
  __SET_VAR(data__->CTD0.,CD,,__GET_VAR(data__->R_TRIG2.Q,));
  __SET_VAR(data__->CTD0.,LD,,__GET_LOCATED(data__->LOAD,));
  __SET_VAR(data__->CTD0.,PV,,5);
  CTD_body__(&data__->CTD0);
  __SET_LOCATED(data__->,CTOVER2,,__GET_VAR(data__->CTD0.Q,));
  __SET_LOCATED(data__->,ALWAYSON,,__BOOL_LITERAL(TRUE));

  goto __end;

__end:
  return;
} // COUNTERTEST1_body__() 





