Skip to Main Content Skip to Search
Product Documentation

Examples Using Stateflow Charts and SimEvents Blocks

Failure State of Server

The examples in Using Stateflow Charts to Implement a Failure State use Stateflow charts to implement the logic that determines whether a server is down, under repair, or operational. SimEvents blocks model the asynchronous arrival of customers, advancement of customers through a queue and server, and asynchronous failures of the server. While these examples could alternatively have represented the server's states using signal values instead of states of a Stateflow chart, the chart approach is more intuitive and scales more easily to include additional complexity.

Go-Back-N ARQ Model

The Packet Communication Within a Go-Back-N ARQ System demo uses SimEvents and Stateflow blocks to model a communication system. SimEvents blocks implement the movement of data frames and acknowledgment messages from one part of the system to another. Stateflow blocks implement the logical transitions among finitely many state values of the transmitter and the receiver.

Receiver State

At the receiver, the chart decides whether to accept or discard an incoming frame of data, records the identifier of the last accepted frame, and regulates the creation of acknowledgment messages. Interactions between the Stateflow chart and SimEvents blocks include these:

Transmitter State

At the transmitter, the chart controls the transmission and retransmission of frames. Interactions between the Stateflow chart and SimEvents blocks include these:

  


Free Discrete Event Simulation Technical Kit

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS