Run Sample Models

One way to become familiar with the basics of SimEvents® models and the way they work is to examine and run a previously built model. See SimEvents Examples for these examples.

Examine Entities and Ports in a Model

The seExampleTankFilling model illustrates entity and statistics output lines.

A thick double arrow line indicates the flow of entities.

The report of statistics is an important part of the SimEvents blocks. Various SimEvents blocks can report statistics such as:

  • Number of entities departed

  • Number of entities in the block

  • Number of pending entities

When you request a statistic for a block, the output ports for the block extend from the top of the block, with a label for each port. Here is an example of an Entity Terminator block displaying the number of entities arrived (a).

To examine a statistic, you can connect the line to a Simulink® scope.

    Note:   You can also examine the path of entities using the Message Viewer by inserting a Message Viewer block in your model.

Entity Connections

Some blocks in this model can process entities, discussed in the What Is an Entity? section.

The Entity Generator block and the Entity Queue block, which are part of the SimEvents library set, process entities in this model. Each of these blocks has an entity input port and an entity output port. The figure shows the entity output port of the Entity Generator block and the entity input port of the Entity Queue block.

A thick double arrow line indicates the flow of entities.

Entity connection lines represent relationships between two blocks (or between their entity ports) by indicating a path by which an entity can:

  • Depart from one block

  • Arrive simultaneously at a subsequent block

When you run the simulation, entities that depart from the output port arrive simultaneously at the input port.

You cannot branch an entity connection line. If your application requires an entity to arrive at multiple blocks, use the Entity Replicator block to create copies of the entity. In addition, you can route entities using the input and output switch blocks

Data Connections

A SimEvents model can also use a signal line that represents persistent value-based data such as statistics and states. This line looks like a typical Simulink signal line. Such signals have no associated events and event actions.

Entity Appearance

Entities do not appear explicitly in the model window. However, you can gather information about entities using Simulink scopes.

Run the Simulation

To run the seExampleTankFilling simulation, choose Simulation > Run from the model window.

See Also

| | | | | | | | | | | | | | | |

Related Examples

More About

Was this topic helpful?