Stateflow Embedded Coder default state

1 view (last 30 days)
Mirko
Mirko on 18 May 2020
Hello, is there any way to configure the default state in generating embedded coder code from a stateflow project?
case CTRL_Sistema_ETM_Type_ETM_ATTIVO
:
switch (Uport_CTRL_Sistema_ETM.Stato_CTRL_Alimentazione) {
case CTRL_Alimentazione_Type_Sistema_Attivo:
Yport_CTRL_Sistema_ETM.Stato_CTRL_Sistema_ETM =
CTRL_Sistema_ETM_Type_ETM_ATTIVO;
break;
case CTRL_Alimentazione_Type_MCC_NON_Alimentati:
Yport_CTRL_Sistema_ETM.step = 0U;
Yport_CTRL_Sistema_ETM.Stato_CTRL_Sistema_ETM =
CTRL_Sistema_ETM_Type_ETM_NON_ATTIVO;
break;
case CTRL_Alimentazione_Type_SError:
Yport_CTRL_Sistema_ETM.Stato_CTRL_Sistema_ETM =
CTRL_Sistema_ETM_Type_S1Error;
break;
}
break;
case CTRL_Sistema_ETM_Type_S1Error:
Yport_CTRL_Sistema_ETM.Stato_CTRL_Sistema_ETM =
CTRL_Sistema_ETM_Type_ETM_NON_ATTIVO;
break;
default:
switch (Uport_CTRL_Sistema_ETM.Stato_CTRL_Alimentazione) {
case CTRL_Alimentazione_Type_Sistema_Attivo:
Yport_CTRL_Sistema_ETM.Stato_CTRL_Sistema_ETM =
CTRL_Sistema_ETM_Type_ETM_ATTIVO_RIPETITORE;
break;
case CTRL_Alimentazione_Type_MCC_NON_Alimentati:
Yport_CTRL_Sistema_ETM.step = 0U;
Yport_CTRL_Sistema_ETM.Stato_CTRL_Sistema_ETM =
CTRL_Sistema_ETM_Type_ETM_NON_ATTIVO;
break;
case CTRL_Alimentazione_Type_SError:
Yport_CTRL_Sistema_ETM.Stato_CTRL_Sistema_ETM =
CTRL_Sistema_ETM_Type_S1Error;
break;
}
break;
}
}
I entered the stateflow model and part of the generated code.
I wish the default state was S1Error. Is there any way to configure this state as default?
Thanks for your help

Answers (0)

Categories

Find more on Embedded Coder in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!