background simulation inside simulation

13 次查看(过去 30 天)
I've got a problem and hopefully anyone can help me. There are 2 Simulink models. The first model ("Main Model") needs to execute another model("Submodel"), which can run in the background. The results of the submodel, need to be available for the main model (not necessarily in the next simulation step). The submodel should be realized inside the main model (one mdl file!).
The input for the submodel is a matrix which consists of time steps (e.g. [0;1;2;...10] and corresponding speed values. This matrix is created by the main model at a certain time....
At the moment I'm trying to implement the submodel as a model reference, which is running in SIL mode.
I get the following error message: "Block 'Subsystem/In1' uses continuous time, which is not supported with the current configuration. Consider selecting the support 'continuous time' option on the Configuration Parameters > Code Generation > Interface pane"
If I select the 'continous time' option I get another error message: "The referenced model "Subsystem" is configured to support continuous time. Continuous time is not supported by Model blocks in SIL or PIL mode. To avoid this error you can uncheck support for "continuous time" on the Code Generation > Interface pane of Configuration Parameters."
The subsystem consists only of an input, a gain block and an output block (for testing purposes)
Is it the right direction to realize this with a model reference block which is running in SIL mode???
Thanks a lot!

采纳的回答

Ryan G
Ryan G 2012-8-15
If you are trying to run PIL/SIL mode you cannot use continuous time blocks, such as an integrator or transfer function, because when code is generated for deployment in those applications it has to be discrete.
You can resolve the issue by replacing any continuous time blocks with discrete blocks such as discrete integrators and discrete transfer functions.
  1 个评论
Kaustubha Govind
Kaustubha Govind 2012-8-15
Also, I would recommending turning on Sample Time colors in the model being referenced to figure out which blocks are configured with continuous time (denoted with black).

请先登录,再进行评论。

更多回答(2 个)

Florian
Florian 2012-8-15
Thanks, could solve this problem. But of course, there's now anouther error message. The Referenced model doesn't accept my matrix, which consists of the above mentioned time steps and corresponding speed values. The model reference submodel expects just one value......?!
  1 个评论
Ryan G
Ryan G 2012-8-15
Could you elaborate on this a bit more. How are you setting up the input (constant block, inport, from workspace) to the model reference? You can turn on signal dimensions to determine what the size of the signal should be.

请先登录,再进行评论。


Florian
Florian 2012-8-15
in the end I want to upload that model on a control box, on which that submodel is a simulation, that is run on that control box....

类别

Help CenterFile Exchange 中查找有关 Subsystems 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by