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

1 次查看(过去 30 天)
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
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 CenterFile Exchange 中查找有关 Deployment, 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