Effacer les filtres
Effacer les filtres

How do I flow Block Annotation settings through a Configurable Subsystem?

4 vues (au cours des 30 derniers jours)
Bill
Bill le 5 Nov 2014
Commenté : Bill le 6 Nov 2014
When using a Configurable Subsystem block to switch between library blocks I see the Configurable Subsystem does a nice job of representing the mask properties in the chosen block. However, Block Annotation is not showing up. Is there a way to flow up the Block Annotation properties? Normally I am showing parameter values below the blocks by using Block Annotation but this doesn’t work if I wrap the blocks in a Configurable Subsystem.

Réponse acceptée

Sreeram Mohan
Sreeram Mohan le 6 Nov 2014
Hi Bill,
You could try something like this, I am not sure if this will work but worth a try : In the copyfcn call back of the configurable subsystem template block add a call back 1) Get the current block choice 2) Get the full path of the block and then get the paremeter values that are needed. 3) Concatenate all of the values into a string 4) set the AttributesFormatString property with the string formed in step 3. set_param(gcb, 'AttributesFormatString', string);
If the copyFcn callback does not work you could may be create a subsystem on the configurable subsystem block and use set_param(gcb, 'AttributesFormatString', string)on by getting the properties in the model. This would definitely work but adds a extra layer (but its virtual subsystem so should not be a performance hit though!!)
Hope this helps !!!
Sreeram
  1 commentaire
Bill
Bill le 6 Nov 2014
Thanks Sreeram -
To get the values within the selected block I can use: Par1 = get_param([gcb,'/',get_param(gcb, 'BlockChoice')], 'Par1'); Par2 = get_param([gcb,'/',get_param(gcb, 'BlockChoice')], 'Par2'); set_param(gcb, 'AttributesFormatString', [Par1, ' / ', Par2]);
OR Alternatively to just copy the Block Annotation: set_param(gcb, 'AttributesFormatString', get_param([gcb,'/',get_param(gcb, 'BlockChoice')], 'AttributesFormatString'))
I put the code into the InitFcn callback to run when model is updated.
Thanks for the help! - Bill

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by