How do I pass the mask parameter to a goto block underneath and to the GotoTag parameter in Simulink 8.0 (R2012b)?

3 ビュー (過去 30 日間)
I have one mask parameter that I am trying to pass to a goto block underneath and to the GotoTag parameter.

採用された回答

MathWorks Support Team
MathWorks Support Team 2013 年 1 月 18 日
With respect to the modifying GOTO tag names, using Mask Parameters, I am attaching a SLX file here.
SLX file : MathWorksTS_ExampleMaskParameter_for_Goto.slx which has two subsystems 'Subsystem' and 'Subsystem1'.
'Subsystem' demonstrates usage of 'set_param' along with a Dialog Callback of the Dialog Parameter for 'GOTO_NAME'. The callback is in 'MaskDialogCallback.m' script in the ZIP folder. The script changes the 'GotoTag' of the Goto block with the provided string value.
The 'MaskDialogCallback.m' script should have the following code:
blk = gcb;
GotoTagString = get_param(blk,'GOTO_NAME');
set_param([gcb '/Goto'],'GotoTag',GotoTagString)
Please note, usage of 'set_param' might not be the ideal scenario, because it might lead to possible conflicts and hence it is not recommended to use 'set_param' for blocks under the mask.
Another option is if you know of all possible 'Goto' blocks then can use a Switch Case in the Mask Dialog to select one of the Goto block. The 'Subsystem1' demonstrates this workflow. Edit the mask to understand the workflow. The different Goto blocks are inside the 'Switch Case Action Subsystem' blocks. This is a recommended workflow if you are aware of all available goto blocks.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComponent-Based Modeling についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2012b

Community Treasure Hunt

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

Start Hunting!

Translated by