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.
|Mealy||Classic||Mealy charts retain their semantics when changed to Classic type.|
|Classic||Mealy||If the Classic chart confirms to Mealy semantic rules, the Mealy chart exhibits equivalent behavior, provided that output is defined at every time step.|
|Moore||Classic||State 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.|
|Classic||Moore||Actions 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.|
|Mealy||Moore||Converting between these two types does not produce equivalent behavior because Mealy and Moore rules about placement of actions are mutually exclusive. Requires redesign.|