The Discrete-Event Chart block is similar to a Stateflow® chart but is used for discrete events.
A Stateflow Discrete-Event Chart block can receive, process, and send SimEvents® entities. Using Stateflow Discrete-Event Chart block to create SimEvents systems lets you take advantage of the graphical state transition and MATLAB® action language used in Stateflow software. The Discrete-Event Chart block can be used in a similar fashion to the Stateflow Chart.
The distinguishing characteristic of the Discrete-Event Chart block is that it executes in an event-based rather than time-based fashion. The Discrete-Event Chart block provides these advantages for discrete-event modeling:
Precise timing — The time resolution for occurrence of events can be arbitrarily precise and is not limited by the sample time of the model.
For more information, see Discrete-Event Chart Precise Timing.
Trigger on arrival — A Discrete Event Chart block executes immediately on message arrival. It does not wait for the next sample time hit.
For more information, see Trigger a Discrete-Event Chart Block on Message Arrival.
Variable execution order — A Discrete Event Chart block does not have a fixed sorted execution order. The order of execution depends on the run-time conditions of the model.
For more information, see Dynamic Scheduling of Discrete-Event Chart Block.
Multiple executions per time step — A Discrete Event Chart block can execute zero or multiple times in a single time step.
For more information, see Dynamic Scheduling of Discrete-Event Chart Block.
With SimEvents software, you can view, edit, and simulate your Discrete Event Chart custom block within a SimEvents example model. However, to save the model you must have a Stateflow license.
For new models, without a Stateflow license, you can view and edit the model, but cannot simulate or save it.
The entities you use with discrete-event charts can be bus objects or anonymous entities.