background simulation inside simulation

9 views (last 30 days)
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!

Accepted Answer

Ryan G
Ryan G on 15 Aug 2012
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 Comment
Kaustubha Govind
Kaustubha Govind on 15 Aug 2012
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).

Sign in to comment.

More Answers (2)

Florian
Florian on 15 Aug 2012
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 Comment
Ryan G
Ryan G on 15 Aug 2012
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.

Sign in to comment.


Florian
Florian on 15 Aug 2012
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....

Products

Community Treasure Hunt

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

Start Hunting!