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 次查看(过去 30 天)
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

采纳的回答

Sahithi Kanumarlapudi
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!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Prepare Model Inputs and Outputs 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by