How to change the execution mode of the real-time application in slrt from Singletasking to Multitasking?
4 views (last 30 days)
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 on 4 Apr 2022
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.