- 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
조회 수: 4 (최근 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!