Working with Discrete Event Subsystem Blocks

www.kxcad.net Home > CAE Software Index > MATLAB Index >


Your Ad Here

For discrete event subsystems that respond to entity departures rather than signal-based events, see Creating Entity-Departure Subsystems.

Setting Up Signal-Based Discrete Event Subsystems

Building on the conceptual information in Role of Discrete Event Subsystems in SimEvents Models, this section provides some practical information to help you incorporate Discrete Event Subsystem blocks into your SimEvents models.

To create discrete event subsystems that respond to signal-based events, follow the procedure below using blocks in the SimEvents Ports and Subsystems library.

  1. Drag the Discrete Event Subsystem block from the SimEvents Ports and Subsystems library into your model. Initially, it shows one signal input port Din and one signal output port Dout. Note that these are signal ports, not entity ports, because the subsystem is designed to process signals rather than entities. Furthermore, the signal input ports carry only real scalar signals of data type double.

  2. In the model window, double-click the Discrete Event Subsystem block to open the subsystem it represents. Initially, the subsystem contains an inport block connected to an outport block. Note that these are Discrete Event Inport and Discrete Event Outport blocks, which are not the same as the Inport and Outport blocks in the Simulink Ports & Subsystems library. The subsystem also contains a Subsystem Configuration block, which you should not delete.

  3. A discrete event subsystem must have at least one input that determines when the subsystem executes. To change the number of inputs or outputs to the subsystem, change the number of inport and outport blocks in the subsystem window:

  4. Drag other blocks into the subsystem window as appropriate to build the subsystem. This step is similar to the process of building the top level of your model, except that only certain types of blocks are suitable for use inside the subsystem. See Blocks Inside Discrete Event Subsystems for details.

  5. Configure each of the Discrete Event Inport blocks to indicate when the subsystem should be executed. Each inport block independently determines criteria for executing the subsystem:

Signal-Based Events That Control Discrete Event Subsystems

Blocks in a Discrete Event Subsystem are called in response to signal-based events. Using the dialog box of the Discrete Event Inport blocks inside the subsystem, you configure the subsystem so that it is executed in response to

Multiple-Input Subsystems

In a discrete event subsystem containing multiple Discrete Event Inport blocks, the subsystem is executed when at least one of the inport blocks detects a qualifying event. If N qualifying events occur at the same simulation time (whether at the same or different Discrete Event Inport blocks), then the subsystem executes N times and updates its output signals N times.

If you want one of the inport blocks to provide an input signal without affecting the times at which the subsystem is executed, then clear the Execute subsystem upon signal-based event check box on that inport block. However, always select Execute subsystem upon signal-based event for at least one inport block of the subsystem or else the subsystem will never be executed.

Comparison of Event Types for Discrete Event Subsystems

Here are some points to keep in mind when deciding which type of signal-based event should call your discrete event subsystem:

For more information about signal-based events, see Types of Supported Events.

  


© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments

Your Ad Here