Is concurrent execution not possible for a Simulink model with sample time less than 1ms ?

1 回表示 (過去 30 日間)
Bhavanithya Thiraviaraja
Bhavanithya Thiraviaraja 2018 年 5 月 9 日
回答済み: Qing Liu 2019 年 12 月 16 日
I have a simple simulink model same as the example Mathworks Data Parallelism. When I change the sample time of this model from 1 (original value in the sample model) to 0.0001 and try to build the model, simulink throws a block diagram error,
### Build procedure for model: 'data_parallel_model' aborted due to an error.
Error: The periodic trigger Periodic of model data_parallel_model has a base rate smaller than 1 ms. The current base rate is 0.0001 seconds. Increase the base rate of the periodic trigger by increasing the rate in the model.
For easy reference, I have attached the snippet of the concurrent execution window,
The periodic Trigger has a period of 0.0001 and also the same for every Task under it.
Is this because the concurrent execution or the CPU cores have a Limitation for sample time less than 1ms or am I doing something wrong?

回答 (3 件)

shi chen
shi chen 2018 年 11 月 15 日
Have you solved this problem?
  2 件のコメント
Bhavanithya Thiraviaraja
Bhavanithya Thiraviaraja 2018 年 11 月 17 日
The error did not arise when I increased the sample time to 1ms or more. I am not sure if this helps you.
Unfortunately, for my application, concurrent execution was not the optimal solution, so I had to drop it.
shi chen
shi chen 2018 年 11 月 18 日
I also changed the sample time to 1ms or more like you, and the model passed. But for my application, the sample time must be less than 100us. I have to manually write the code to assign tasks.

サインインしてコメントする。


Dimitri Lindt
Dimitri Lindt 2019 年 2 月 22 日
Hello, I have the same problem.
How can I automatically generate a code with a cycle time (periodic time/sample time) shorter than 1 ms?
Can one help?
Thanks in advance!

Qing Liu
Qing Liu 2019 年 12 月 16 日
I answered the same question here:
An tricky method : manually modify the tlc file( <MATLAB_ROOT>/rtw/c/tlc/mw/ertwinthread.tlc )
comment out lines 773-780 (as follow) from
773 %if ((period * 1000) < 1)
774 %if LibIsDeploymentDiagram()
775 %assign errormsg = "The periodic trigger %<LibGetTriggerName(ehIdx)> of model %<::CompiledModel.Name> has a base rate smaller than 1 ms. The current base rate is %<period> seconds. Increase the base rate of the periodic trigger by increasing the rate in the model."
776 %else
777 %assign errormsg = "%<::CompiledModel.Name> has a base rate smaller than 1 ms. The current base rate is %<period> seconds. Increase the base rate of the model."
778 %endif
779 %exit %<errormsg>
780 %endif
to this
773 /%%if ((period * 1000) < 1)
774 %if LibIsDeploymentDiagram()
775 %assign errormsg = "The periodic trigger %<LibGetTriggerName(ehIdx)> of model %<::CompiledModel.Name> has a base rate smaller than 1 ms. The current base rate is %<period> seconds. Increase the base rate of the periodic trigger by increasing the rate in the model."
776 %else
777 %assign errormsg = "%<::CompiledModel.Name> has a base rate smaller than 1 ms. The current base rate is %<period> seconds. Increase the base rate of the model."
778 %endif
779 %exit %<errormsg>
780 %endif%/
and the Code Generation process will skip the check of the time step greater than 1ms.
Hopes to help you!

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by