Conditionally Executed Subsystems and Models

Control when a subsystem or model is executed

A conditionally executed subsystem or conditionally executed referenced model runs:

  • Once at the current time step when enabled or triggered by an external signal

  • One or more times during a time step when receiving a function-call event.

The external signal, called the control signal, is attached to the control input port.

For subsystems that run after evaluating a condition, see Logical Conditionally Executed Subsystems.

Blocks

expand all

Enabled SubsystemSubsystem whose execution is enabled by external input
Triggered SubsystemSubsystem whose execution is triggered by external input
Enabled and Triggered SubsystemSubsystem whose execution is enabled and triggered by external inputs
EnableAdd enable port to subsystem or model
TriggerAdd trigger or function port to subsystem or model
Function-Call SubsystemSubsystem whose execution is controlled by an external function-call input
Function-Call GeneratorProvide function-call events to control execution of a subsystem or model
Function-Call SplitProvide junction for splitting function-call line
Function-Call Feedback LatchBreak feedback loop involving data signals between function-call blocks
TriggerAdd trigger or function port to subsystem or model

Topics

Introduction

Conditionally Executed Subsystems Overview

Overview of conditionally executed subsystems.

Modify Referenced Models for Conditional Execution

Execute referenced models conditionally, similar to conditionally executed subsystems.

Ensure Outport is Virtual

Option on a conditional subsystem or root-level Outport block.

Enabled and Triggered Subsystems

Using Enabled Subsystems

Create a subsystem that executes when a control signal has a positive value.

Using Triggered Subsystems

Create a subsystem that executes with a trigger signal.

Using Enabled and Triggered Subsystems

Create a subsystem that executes with a trigger signal or control signal with a positive value.

Function-Call Subsystems

Using Function-Call Subsystems

Create a subsystem that executes with a function call.

Subsystem Output Initialization

Conditional Subsystem Initial Output Values

Specify initial output values for a conditional subsystem.

Conditional Subsystem Output Values When Disabled

Specify output behavior when conditional subsystem is disabled.

Simplified Initialization Mode

Control initial values for conditional subsystems.

Featured Examples