How to change the execution mode of the real-time application in slrt from Singletasking to Multitasking?

조회 수: 4 (최근 30일)
As shown in the figure below,I create a simulink model that have 3 unrelated tasks. I hope these tasks can simultaneously run on different cores of the target computer cpu. What should I do? I try to build this model into Real-Time Multitasking Execution mode.
As shown in the figure below,I chose the Allow task execute concurrently on target option in the Solver pane. Furthermore,the get_param function return the MultiTasking result.
But, when i load this real-time application into the target and run it. The application execution mode is still Single-Tasking.
So, How to change the execution mode of the real-time application from Singletasking to Multitasking?

채택된 답변

Dimitri MANKOV
Dimitri MANKOV 2022년 4월 4일
Hi Liqun,
This is most likely due to the fact that your model uses only one sample rate. You can confirm this by highlighting the blocks of your model according to their sample time, see here.
By default, Simulink Coder can automatically partition the model into several tasks only if there are multiple rates defined in the model. Then each rate would get its own task.
If you need to run blocks that use the same step size in different tasks, you need to use explicit (manual) partitioning. You can find an example showing how to do that here.
Best,
Dimitri
  댓글 수: 3
Dimitri MANKOV
Dimitri MANKOV 2022년 4월 5일
That's correct: each task runs on a separate CPU core. The core assignment is done automatically, the user has no control over that. Tasks are sorted by priority (lower step size => higher priority), and a task can be preempted ("paused") to free a CPU core for a task with higher priority if necessary.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multicore Processor Targets에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by