| Contents | Index |
| On this page… |
|---|
When to Perform Computations on Event-Based Signals Without Using Subsystems |
In some situations, you can perform computations on an event-based signal by connecting it directly to computational blocks, without putting the blocks in an Atomic Subsystem or Function-Call Subsystem block. Direct connections make the model easier to construct.
Insert computational blocks into your model and connect them directly to event-based signals. If the block has a Sample time parameter in the block dialog box, you must set Sample time to -1 to indicate an inherited sample time.
When a connected set of computational blocks has event-based input signals, the behavior depends on whether the blocks are in a nonvirtual subsystem, such as an Atomic Subsystem or Function-Call Subsystem block.
When a nonvirtual subsystem executes, the application determines an execution sequence that accounts for data dependencies among the blocks. Each block in the subsystem executes once, in that predetermined sequence.
Without the nonvirtual subsystem, event-based input signals execute blocks upon the sample time hits of those input signals.
For details about how blocks behave when they have event-based input signals and are not in a nonvirtual subsystem, see Execution of Blocks Having Event-Based Input Signals.
To change the initial value for any event-based signal that is not in a nonvirtual subsystem, connect the signal to the Initial Value block.
As you build your model, it might evolve from a situation in which direct connections of event-based signals to computational blocks is appropriate, to a situation in which it is better to perform the computation in an Atomic Subsystem block. Be alert to changes that your computation involves a block that has any of these characteristics:
The block does not support event-based input signals.
You do not want the block to respond immediately to each sample time hit of each event-based input signal.
To migrate your computation to an Atomic Subsystem block, see Creating an Atomic Subsystem from Existing Blocks.
![]() | Blocks Inside Subsystems with Event-Based Input Signals | Plotting Data | ![]() |

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |