Effects of Changing the Chart Type

The best practice is to not change from one Stateflow® chart type to another in the middle of development. You cannot automatically convert the semantics of the original chart to conform to the design rules of the new chart type. Changing type usually requires you to redesign your chart to achieve equivalent behavior — that is, where both charts produce the same sequence of outputs given the identical sequence of inputs. To assist you, diagnostic messages appear at compile time (see Debug Mealy and Moore Charts). In some cases, however, there may be no way to translate specific behaviors without violating chart definitions.

Here is a summary of what happens when you change chart types mid-design.

MealyClassicMealy charts retain their semantics when changed to Classic type.
ClassicMealyIf the Classic chart confirms to Mealy semantic rules, the Mealy chart exhibits equivalent behavior, provided that output is defined at every time step.
MooreClassicState actions in the Moore chart behave as entry actions because they are not labeled. Therefore, the Classic chart will not exhibit behavior that is equivalent to the original Moore chart. Requires redesign.
ClassicMooreActions that are unlabeled in the Classic chart ( entry actions by default) behave as during and exit actions. Therefore, the Moore chart will not exhibit behavior that is equivalent to the original Classic chart. Requires redesign.
MealyMooreConverting between these two types does not produce equivalent behavior because Mealy and Moore rules about placement of actions are mutually exclusive. Requires redesign.
Was this topic helpful?