Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Sreeram Mohan
Sreeram Mohan el 6 de Nov. de 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 comentario
Bill
Bill el 6 de Nov. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by