필터 지우기
필터 지우기

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

조회 수: 4 (최근 30일)
Bill
Bill 2014년 11월 5일
댓글: Bill 2014년 11월 6일
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.

채택된 답변

Sreeram Mohan
Sreeram Mohan 2014년 11월 6일
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
Bill
Bill 2014년 11월 6일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by