How can I use 'To Workspace' and 'To File' blocks in Model Reference block with configuration parameter 'Total number of instances allowed per top model' set to 'Multi'?

8 views (last 30 days)
Hi,
I am facing a problem with a Simulink model utilizing Model References. Inside one of the referenced models, I want to log some data variables using a 'To Workspace' and a 'To File' block. To use these blocks Matlab advises me to set the configuration parameter 'Total number of instances allowed per top model' of the afftected Model Reference to 'One' instead of 'Multi'.
The Simulink model is being used for desktop simulation as well as for code generation, in order for the code generation to work the abovementioned parameter is supposed to be 'Multi', so changing it is no option. Also due to the overall model structure and definition of input/output signals the 'To Workspace' and a 'To File' blocks should stay inside the referenced model and can not be moved to the top-level model.
Is there a way to keep these blocks inside the referenced model without changing the number of allowed instances parameter? Or is there maybe another solution for logging specific data from desktop simulation?
Thanks in advance

Accepted Answer

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi on 16 Aug 2019
You cannot reference a model more than once in a model hierarchy if the referenced model contains To File’ blocks.
You can have a look into the following link for further information on the limitations of model reference
In order to log data when using reference models ‘Log Selected Signals’ can be used. For further information on how to do that you can refer to the following link
Hope this helps!

More Answers (0)

Categories

Find more on Prepare Model Inputs and Outputs in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!