Architecture of Generated C Code : Main Task: Partition and Flow Control for C : State EXEC Procedures

State EXEC Procedures
void EXEC_st_LIGHT_MODES()
{
switch(st_LIGHT_MODES_isin)
{
case st2_NIGHT :
EXEC_st2_NIGHT();
break;
case st2_STD_BY :
............
}
} /* EXEC_st_LIGHT_MODES */

void EXEC_st_Chart_TMODES()
{
switch (st_Chart_TMODES_isin) {
case nota_Chart_TMODES :
case st_LIGHT_MODES :
EXEC_st_LIGHT_MODES();
break;
default:
}
} /* EXEC_st_Chart_TMODES */
 

The EXEC procedure is actually the heart of the behavioral logic as described in the statecharts. Every non-basic state has an EXEC procedure that activates all the state-logic within a single execution cycle. The EXEC procedure will take care of in state transition, static reactions, and activation of substate EXEC procedures.

The traversal is done hierarchically, starting at the very top state in the module, going down towards the basic states. In case of an “and” state, the orthogonal components are traversed sequentially one after the other but on the same semantic step utilizing the double-buffering mechanism.