Post Save Function callback
4 次查看(过去 30 天)
显示 更早的评论
The PostSaveFcn or CloseFcn do not work on a bus selector block unless I save or close the parent model. Is there a workaround to execute the callback as soon as I close the Message box of the block?
1 个评论
Walter Roberson
2022-11-9
But closing the message box does not close or save the bus selector block...
I would tend to think that if there is a solution, it would have to do with the Mask. See for example https://www.mathworks.com/matlabcentral/answers/1833163-changing-significant-digits-of-constant-block#answer_1082318 in which the Mask is used to configure significant digits. I have not worked with the masks myself so I do not know if they are flexible enough for your situation.
回答(1 个)
Sai
2022-11-25
I understand that you are trying to execute the callback immediately after closing the message box of the block. In MATLAB, there are two types of callbacks named as Model callbacks and Block callbacks. If we make changes to the model callbacks, then generally we will close and re-open the model before executing. But in Block callbacks we need not close the Simulink model, just saving it is enough.
To avoid these closing and re-opening the models, you can use the mask feature.
For more information on mask, please refer to the below documentation
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Author Block Masks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!