Schedule Model Components

Create export-function, rate-based models, and partitions to schedule model for code generation

Scheduling model components for simulation or integration with an external scheduler requires the algorithms to be placed in Atomic Subsystem or Model blocks. The execution rate is then specified as either periodic (scheduled subsystem) or nonperiodic (function-call subsystem).

Partitions are components of a model that execute independently as atomic tasks. In multitasking models, partitions are created from model components. With partitions, you can separate parts of the model that you can explicitly control in the Schedule Editor tool.

The Schedule Editor is a scheduling tool that represents the components in the model known as partitions, the data connections between them, and the execution order of those partitions. The Schedule Editor can only be used on existing components, such as atomic subsystems, export functions, and model blocks. The Schedule Editor is an interactive tool that provides and easy way to view and edit the schedule of the model components.

Blocks

expand all

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
SubsystemGroup blocks to create model hierarchy
InportCreate input port for subsystem or external input

Tools

expand all

Schedule EditorView and edit the schedule of model components (partitions)

Topics

Export Function Models

Export-Function Models

Overview of export-function models and requirements for building models.

Create Export-Function Model

First step for creating independent functions in the generated code.

Test Export-Function Model Simulation Using Input Matrix

Use an input matrix to specify and test function-call event scheduling.

Test Export-Function Model Simulation Using Function-Call Generators

Use multiple Function-Call Generator blocks to test function-call event scheduling.

Test Export-Function Model Simulation Using Stateflow Chart

Use a Stateflow chart to test function-call event scheduling.

Generate Code for Export-Function Model

Generate code for functions that can be integrated with an external scheduler.

Generate Code for Export-Function Model with Rate-Based Model

Generate code from models with function-call and scheduled subsystems.

Rate-Based Models

Rate-Based Models Overview

Specify scheduling of subsystem or model.

Create A Rate-Based Model

Set periodic rates for subsystems.

Test Rate-Based Model Simulation Using Function-Call Generators

Simulate rate-based model

Generate Code from Rate-Based Model

Generate code from the rate-based model, not from the model test harness.

Sorting Rules for Explicitly Scheduled Model Components

Simulink® determines the sorted order for model components (subsystems and referenced models).

Partitions with the Schedule Editor

Create Partitions

Learn the concept of partitions and how to create them from a model.

Schedule the Partitions

Learn about the execution order of the partitions and how to edit the schedule.

Generate Code from a Partitioned Model

Learn about the impact of partitioning and editing the schedule on code generation.

Featured Examples