Azzera filtri
Azzera filtri

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

4 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Sreeram Mohan
Sreeram Mohan il 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 Commento
Bill
Bill il 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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Subsystems in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by