openFcn callback in library blocks

If I configure the openFcn callback of a subsystem that is a library block, the block disappears from the library browser.
Is it possible somehow (by manipulating the .mdl file in a text editor, e.g.) to use the openFcn callback in that context?
The background is, that I want that subsystem to be a switch that executes an M-file.
Thanks, Christian

回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2012 年 3 月 8 日

0 投票

Does the block appear in the library browser if you don't configure the OpenFcn? It seems like the more likely issue is that you may need to mask your subsystem and create either a dummy parameter or add something to the Documentation tab in the Mask.
Christian
Christian 2012 年 3 月 8 日

0 投票

Yes, it does appear in the library browser if I do not configure the OpenFcn callback. If I move the code to the PreSaveFcn, for example, the block does appear in the library browser.
To make sure, I have added text to the Documentation field of the block mask. It did not have an effect.
By chance, do you know another way to implement a 'button' in Simulink?

2 件のコメント

Kaustubha Govind
Kaustubha Govind 2012 年 3 月 9 日
Is this an empty subsystem then? See if creating a dummy parameter called ShowInLibBrowser on the mask fixes the issue.
Wenfei Wang
Wenfei Wang 2023 年 1 月 20 日
This solved the same issue I had.

サインインしてコメントする。

カテゴリ

製品

質問済み:

2012 年 3 月 8 日

コメント済み:

2023 年 1 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by