How can I link a data dictionary to a Simulink block library?

12 ビュー (過去 30 日間)
Shekhar Malani
Shekhar Malani 2017 年 12 月 20 日
コメント済み: Sherman 2023 年 3 月 21 日
Hello, I have created a simulink library with blocks. In a simulink library block I have defined some variables, now I want link the simulink library with data dictionary. How can I link the simulink library with data dictionary?

回答 (3 件)

Niraj Gadakari
Niraj Gadakari 2017 年 12 月 29 日
Currently, it is not possible for libraries to have dictionaries linked to them, dictionary related items will be hidden from the menus if it is a library. Only Model blocks (Referenced Models) can have sldd links or references.

riccardo
riccardo 2020 年 12 月 13 日
編集済み: riccardo 2020 年 12 月 13 日
It's an old one, but as I had to tackle a similar issue, I thought this might be useful to others.
You cannot link a library block "as is" to a data dictionary.
As your library block will be used in a model, anyway, there are some workarounds possible, like making use of callbacks to add the relevant Data Dictionary entries to the "host" model via Data Dictionary API utilities, which is what one is generally interested in. In this way, when you copy across or initialise or delete the library block, the callback will handle the Data Dictionary entries for the host model.
If you want to build a library to perform library-based code-generation, as described in https://www.mathworks.com/help/ecoder/ug/library-based-code-generation-for-subsystems-shared-across-models.html ,
you can equip the exported interface model with the desired data dictionary. Once the library is built, it is sufficient to make sure that the host model is also equipped with the correct Data Dictionary - you shouldn't need any callback.

Sameer Muckatira
Sameer Muckatira 2021 年 5 月 17 日
https://www.mathworks.com/help/simulink//ug/link-data-dictionary-to-custom-libraries.html
  2 件のコメント
Ka-lip Chu
Ka-lip Chu 2021 年 12 月 3 日
Hello Muckatira,
The External Data tab does not exist in my custom library property.
What is the version of this function? It is not written in the page. I am using R2019b.
Thank you for your time.
Sherman
Sherman 2023 年 3 月 21 日
R2021b or later.

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

カテゴリ

Help Center および File ExchangeManage Design Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by