Simulink multirate scheduling and task preemption
1 次查看(过去 30 天)
显示 更早的评论
Hi
After I suspected that for some reason Simulink is not preempting lower priority (longer timesample) for a higher priority (shorter time sample) I've built a simple simulink model that reproduce the thing. It has:
1- some computation demanding operation (I'm using optflow) that will take about 150 ms of execution. This operation is performed at a rate of 1Hz
2- an C s-function that acts as a RTC synchronization. simply it delay the execution by the amount needed to run the sim with rtc. I'm using linux clock and sleep services. This s-function outputs the number of missed RTC sync points, so if everything is alright this output should always be zero. This s-function is executed at rate of 10Hz
I noticed that whenever the optflow is running the rtc sync s-function misses a sync point because the simulink scheduler has not preempted the (150 ms) executing task to catch the (100ms) time tick
I've tried the previous simulation in normal/accelerator/rapid accelerator and external mode with multi-tasking chosen in the configuration parameters and I'm getting the exact same result while according to: http://www.mathworks.co.uk/products/simulink-coder/description5.html and http://www.mathworks.co.uk/help/toolbox/rtw/ug/f996849.html the coder should procude a code that handles the preemption properly to catch all time samples.
I appreciate if someone points out what I'm I missing
Kind regards,
Mohamad
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!