Borrar filtros
Borrar filtros

FindVars of all modelVariants.

6 visualizaciones (últimos 30 días)
Reuben Symons
Reuben Symons el 7 de Abr. de 2022
Respondida: Jaynik el 15 de Dic. de 2023
I would like to be able to find all variables of a reference model including those from inactive variants.
load_system(model);
Vars = Simulink.findVars(model,'SearchReferencedModels','on','FindUsedVars','on','SourceType','data dictionary','IncludeEnumTypes','on');
Gets me what I want from the active variant but not the inactive ones. The documentation for findVars indicates that setting Variant activation time parameter to code compile in the Variant Subsystem block dialog box. Would solve my problem but I do not have the option to modify the model.
I could cycle through variants performing findVars each time but this seems very innefficient. Is there another good option to get what I am looking for?

Respuestas (1)

Jaynik
Jaynik el 15 de Dic. de 2023
Hi Reuben,
I understand that you want to find all variables of a reference model including the inactive variants but do not have access to the model.
In that case, you're limited in your ability to use "Simulink.findVars". It is essential to verify that the model is set up to utilize a data dictionary and that the variant configurations are properly defined to ensure that inactive variant branches are not inadvertently excluded during the compilation process.
Please note, as per the documentation "Simulink.findVars" does not work as expected when "SearchReferencedModels" is specified as "on" for models configured with parallel model reference builds. Hence, changing the usage of additional options could help.
You can refer the following part of documentation and change the attributes accordingly:
In order to assist you further and to accurately reproduce the issue on my end, it would be beneficial to have access to the model along with the information regarding the parameters and settings currently in use.
Hope this helps!
Regards,
Jaynik

Categorías

Más información sobre Component-Based Modeling en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by