Why can't I find a 'Stateflow.EMChart' behind a masked library block?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 8 Dic 2022
Risposto: MathWorks Support Team
il 26 Gen 2023
I have a model and a custom library. The custom library contains a masked subsystem, within which is a 'MATLAB Function Block'. I have placed an instance of the masked subsystem into my main model.
Before I moved the masked subsystem into the library, I used the following command to get the 'MATLAB Function Block' as a 'Stateflow.EMChart':
block = find(get_param(block_name, "Object"), '-isa', 'Stateflow.EMChart');
But now that I am using the masked subsystem as a library block, the above command returns an empty cell array. To get a value again, I have to first call
set_param(gcb,'LinkStatus','none');
to disable the masked subsystem's library link.
Disabling the library link is not ideal. Is there a way I can find the 'Stateflow.EMChart' without disabling the link?
Risposta accettata
MathWorks Support Team
il 8 Dic 2022
Disabling the link status of the library block is the only way to access the 'Stateflow.EMChart' of the 'MATLAB Function Block' with this configuration of blocks.
In general, accessing a 'Stateflow.EMChart' behind a mask is not a recommended practice as it goes against model-based-design principles. Instead, it is recommended to use 'Variant Systems' to accomplish the behavior you have described.
You can learn more about 'Variant Systems' at the link below:
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Subsystems in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!