Skip to Content
Block descriptionsSystemTask

Task Block Description

This block is used to define tasks that are executed within the Simulink model. Tasks can be triggered at specified time intervals. This block is particularly useful when the model contains blocks that need to be executed at regular intervals, e.g., every 10 ms or every 100 ms. It also plays an essential role in grouping and organizing code blocks.



Task block

Table of Contents

Inputs

This block has no inputs.

Outputs

This block has no outputs.

Block Operation

Other blocks that need to be executed at specific intervals can be placed inside this block. The Task block can be used to group code blocks that should be executed together within a single task. Multiple Task blocks can be defined in a Simulink model, each with different time intervals.

Each Task block must have a unique name so that it can be explicitly identified in the model. If there are multiple Task blocks in the model, ensure that each one has a different name. To change it, double-click the TASK_NAME label located underneath. The name must not contain spaces.

To open the block, enter its parameter settings and click the Go To Functions in TASK - Click Here button. The function view will open, where you can rename them and add the corresponding code blocks. Once you have finished editing the functions, return to the Simulink model view and close the Task block.


Task block

Block Parameters

ParameterDescription
Go To Functions in TASK - Click HereA button that enables jumping to the function view inside the Task block. Clicking this button opens the function view, where you can rename functions and add relevant code blocks. After finishing the function edits, return to the Simulink model view and close the Task block.
Task (Subsystem) nameThe name of the task (subsystem) within the Task block. It will update after changes are made.
Sample Time [sec]Function refresh period.

Task block

CubeMX Configuration for a Given MCU Model

This block does not require any configuration within the CubeMX file.

See Also

Last updated on