- Set up the "Task Manager" block to define the tasks and their characteristics. Specify the task periods, execution times, and task functions.
- Create a function-call subsystem that represents the first task. This subsystem should contain the algorithm or logic you want to execute for the first task. Connect the output of this subsystem to the appropriate output port.
- Similarly, create another function-call subsystem that represents the second task. Connect its inputs and outputs accordingly.
- Set up the triggering conditions for the second task to be triggered immediately after the first task. This can be done by connecting the output of the first task subsystem to the appropriate input of the second task subsystem.
- Run the simulation and observe the execution times of the tasks using the Task Execution Time Plot block. This block will show the execution times of each task over time.
Simulate two event-driven tasks using Task Manager to execute 2 function-call subsystems - SoC Blockset
3 次查看(过去 30 天)
显示 更早的评论
I would like to know if it is possible or if there is a way to use SoC Blockset's Task Manager to simulate 2 event-driven tasks that trigger the execution of 2 independent function-call subsystems within a model. I haven't found a way to get it work as the model compiles but when trying to simulate the Task Manager RTE throws different errors.
My objective is to simulate 2 tasks. The first one with fixed period and variable execution time, while the second only triggered immidiately after the first. I am able to simulate the execution time plots, but since these are triggering 2 sub-systems, I was expecting to see also the time variation at the output of the algorithm in the second task (I only implemented a simple counter increment, so it is easy to spot delays in the plotted ramp).
I am not sure if SoC Blockset's blocks are teh best way to simulate this condition, but I really like how it plots simulated the task execution times.
0 个评论
回答(1 个)
Anagha Mittal
2023-9-27
Hi Carlos,
Using SoC Blockset's Task Manager to simulate event-driven tasks that trigger the execution of independent function-call subsystems within a model is possible.
To simulate two tasks with different triggering and execution characteristics, please follow these steps:
Please refer to the followwing documentation link for more information on Event-Driven Tasks:
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Processor Software 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!