Can a Simulink model inherit Data Dictionary links from libraries blocks within other libraries or subsystem references?

I'm working in R2022b. I can build a library, associate a data dictionary with it, then when I use a block from the library in a model the data dictionary shows up in the Model Explorer under External Data > From Libraries. Which is awesome, because I want to associate the component-specific data with their respective libraries then never have to relink those data dictionaries as I use the library blocks throughout my model.
My issue is that as soon as I'm using a library block in a subsystem reference or another library the top-level model won't find the data dictionary. It only finds library linked data dictionaries within the top model file. Can I make it pull in library linked data dictionaries wherever it finds them in the tree?

3 Comments

More exploration:
> When you add a library block to a subsystem file, the data dictionary attached to the library becomes available to the subsystem file. If you refer to the subsystem file from a model using a Subsystem Reference block, the library dictionary is available within the Subsystem Reference block boundary only.
This implies that I should be able to attach a data dictionary to a library, use library blocks within a subsystem, then insert that subsystem into a model. The model won't have access to the data dictionary but the subsystem should. However, this is not the behavior I'm seeing on R2022b. Trying to build the model containing the subsystem reference results in an error; it can't find the reference to data dictionary information even though the library references are contained within a subsystem that should see the data dictionary.
Attached is a sample DD, library, subsystem, and two models (one with the library reference directly and one wrapped in a subsystem reference) that show this difference in behavior.
Update:
I downloaded R2024a and tried the sample code attached above. It works as expected in the newer version. Is this a bug that was fixed, a feature that was added, or a default setting that was changed between R2022b and R2024a?
I have a similar problem with R2023b. I copied a block from a library with a linked data dictionary but the top model doesn't find it. I can't even find the "From Libraries" section in the Model Explorer. Any suggestions?

Sign in to comment.

Answers (1)

Check out these documentations for "Considerations When Using a Library Dictionary" in MATLAB R2023a and MATLAB R2023b. In R2023a, it is clearly stated that there is no support for "Library Dictionary" inside "Subsystem Reference"
I suspect that in MATLAB R2023b, it will support Library Dictionary if you execute one of the commands:
Simulink.LibraryDictionary.resetLibraryLinks
% or
Simulink.LibraryDictionary.refresh

Products

Release

R2022b

Asked:

on 20 Mar 2024

Answered:

on 20 Jan 2025

Community Treasure Hunt

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

Start Hunting!