Documentation

Role of Stateflow Charts in SimEvents Models

SimEvents® software works with Stateflow® software to represent systems containing state-transition diagrams that can produce or be controlled by discrete events. Both software products are related to event-driven modeling, but they play different roles:

  • SimEvents blocks can model the movement of entities through a system so you can learn how such movement relates to overall system activity. Entities can carry data with them. Also, SimEvents blocks can generate events at times that are truly independent of the time steps dictated by the ODE solver in Simulink® software.

  • Stateflow charts can model the state of a block or system. Charts enumerate the possible values of the state and describe the conditions that cause a state transition. Runtime animation in a Stateflow chart depicts transitions but does not indicate movement of data.

For scenarios that combine SimEvents blocks with Stateflow charts, see Scenarios Using Stateflow Charts and SimEvents Blocks.

You can interpret the Signal Latch block with the st output signal enabled as a two-state machine that changes state when read and write events occur. Similarly, you can interpret Input Switch and Output Switch blocks as finite-state machines whose state is the selected entity port. However, Stateflow software offers more flexibility in the kinds of state machines you can model and an intuitive development environment that includes animation of state transitions during the simulation.

Was this topic helpful?