Data Dictionary Not Visible in Model Explorer for Reference Subsystem

조회 수: 24 (최근 30일)
thomas
thomas 2025년 4월 28일
답변: Suman 2025년 5월 14일
Problem Description
I'm working on a Simulink project where I'm using a reference subsystem that is located in another directory. This reference subsystem has its own linked data dictionary.
When I run my main model with this reference subsystem, the simulation works correctly, which indicates that the reference subsystem and its data dictionary are being found and loaded properly. However, in the Model Explorer, I cannot see the data dictionary of the reference subsystem.
Project Structure
  • My main model is in my current project directory
  • The reference subsystem is located in another directory
  • The reference subsystem has a linked data dictionary
I have an initialization script in my project that adds the necessary paths:
% Add shared libraries to the path using relative paths
% This is a script file that directly executes the code
% Get the current project path
currentPath = pwd;
% Construct path to the shared libraries using relative path
sharedLibPath = fullfile(currentPath, '..', '..', '2_Reusable_Components');
% Display the resolved path (for debugging)
fprintf('Attempting to add path: %s\n', sharedLibPath);
% Check if the path exists
if ~exist(sharedLibPath, 'dir')
warning('SharedLibraries path not found: %s', sharedLibPath);
return;
end
% Add the main folder and all subfolders
addpath(genpath(sharedLibPath));
disp('SharedLibraries paths added successfully.');
The main model runs successfully with this initialization script, but I still cannot see the reference subsystem's data dictionary in Model Explorer.
Questions
  1. Is this expected behavior that reference subsystem data dictionaries don't show up in the Model Explorer of the parent model?
  2. If they should be visible, what could be preventing the data dictionary from appearing?
  3. Is there a way to make all linked data dictionaries visible in the Model Explorer regardless of where they come from?
  4. Do I need to explicitly link the same data dictionary to my main model, even though it's already linked to the reference subsystem?
Environment
  • MATLAB Version: 2023b
Thank you for any help or insight you can provide!

답변 (2개)

Anushka
Anushka 2025년 5월 7일
As per my understanding, you are using a referenced subsystem from another directory, which has its own linked data dictionary, and you are expecting to see that dictionary in the ‘Model Explorer’ of the parent(main) model.
“Is this expected behaviour that reference subsystem data dictionaries don't show up in the Model Explorer of the parent model?”
Yes, this is expected behaviour since in MATLAB Simulink, linked data dictionaries are local to the models or subsystems they are linked to. The ‘Model Explorer’ only displays the data dictionary explicitly linked to the open model, not those of referenced models or subsystems unless you explicitly open them.
“If they should be visible, what could be preventing the data dictionary from appearing?”
Since it is expected that they are not visible so the reference subsystem’s dictionary will not be listed in your main model’s Model Explorer unless you explicitly open or navigate to it so there is nothing wrong here.
“Is there a way to make all linked data dictionaries visible in the Model Explorer regardless of where they come from?”
Model Explorer does not automatically auto-generate data dictionaries from references models/subsystems. However, you can manually open referenced subsystem’s data dictionary via:
You can refer to the following documentation to know more this function: https://www.mathworks.com/help/releases/r2023b/simulink/slref/simulink.data.dictionary.open.html
OR
  • In Model Explorer, go to the menu:File > Open > Data Dictionary
  • Navigate to and open the reference subsystem’s “.sldd” file.
  • Now both dictionaries will be visible in the Model Explorer tree.
“Do I need to explicitly link the same data dictionary to my main model, even though it's already linked to the reference subsystem?”
No, you should not link the same dictionary to both models unless you are intentionally sharing a single dictionary across both. Otherwise, you will break modularity and potentially cause conflicts.
You can refer to the following documentation for better understanding about how ‘Model Explorer’ allows you to view and manage data dictionaries: https://www.mathworks.com/help/releases/r2023b/simulink/slref/modelexplorer.html
You can refer to the following documentation to know more details how to reference one data dictionary from another: https://www.mathworks.com/help/releases/r2023b/systemcomposer/ug/referenced-data-dictionaries.html
Hope this helps!

Suman
Suman 2025년 5월 14일
Adding to what Anushka has already mentioned in her answer.
“Is there a way to make all linked data dictionaries visible in the Model Explorer regardless of where they come from?”
Model Explorer will load data dictionary for a model only if it is opened as a top model. Now, to avoid having to open the referenced model or subsytems from the File Browser, you can do it directly from the Model Explorer. In the Model Hierarchy pane on the left, if you click on the SubSystem Reference, you can see the Block Parameters dialog. In this dialog in the "Subsystem Reference" tab, click Open. This will open the referened model as a top model and the associated data dictionary will be visible in Model Explorer.
You can also simply right click on the "Subsystem Reference" block in Simulink editor and select the "Open Subsystem Reference".
Hope that helps!

카테고리

Help CenterFile Exchange에서 Manage Design Data에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by