Post Save Function callback

조회 수: 4 (최근 30일)
Firas
Firas 2022년 11월 9일
댓글: Firas 2022년 12월 6일
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
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
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
  댓글 수: 1
Firas
Firas 2022년 12월 6일
I need to update another block using my own script as soon as I save or close a bus selector block. I tried CloseFcn , Mask and everything but I souldn't get a clear answer, everything is locked and the callbacks are not exactly doing the real job intended? I don't want to execute my script after I save the parent model I want it to be excuted with block dialog closure!

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

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by