Error: Data dictionary linked by a library must not have access to base workspace

14 views (last 30 days)
I have a model that is linked to a data dictionary. The data dictionary has access to base workspace enabled.
When trying to run the model I get the Error "Error: Data dictionary 'x.sldd' linked by a library must not have access to base workspace".
But WHY must it not have access? There is no reason given and I cannot see a pattern when this error occurs. Various other models also have dictionaries with access to base workspace and don't throw this error. What are the potential reasons that prohibit access to base workspace being enabled?
Thanks for your support.

Accepted Answer

Saurav
Saurav on 21 Jul 2025
Hello @Marcus,
I understand that you are encountering the error "Data dictionary 'x.sldd' linked by a library must not have access to base workspace".
This occurs because a library-linked SLDD (Simulink Data Dictionary) is configured to access the base workspace, which is not allowed by design.This restriction is enforced by Simulink’s internal reference manager.
Why this restriction exists:
When a model links to a data dictionary from within a Simulink library, it is meant to behave as a standalone, reusable, and self-contained component. If such a dictionary accesses the base workspace, then:
  • It introduces external dependencies that break modularity.
  • It creates ambiguity during code generation or model reference builds, since workspace values may vary per context.
  • It makes model reuse fragile, especially across projects or in deployment workflows (like Simulink Coder or rapid prototyping).
To enforce robust and portable model behavior, Simulink prohibits any SLDD used within a library from referencing the base workspace, either directly or indirectly (even through referenced dictionaries).
You are right to observe that some models using SLDDs with base workspace access don't throw this error. The key distinction is that those models are not libraries.
This restriction only applies when the dictionary is:
  • Linked to a Simulink library model, not a regular model.
  • Referenced in the closure of the library, i.e., any dictionary in its dependency chain.
The issue can be resolved by disabling base workspace access for the offending dictionary. Make sure to also review any referenced dictionaries within this one; if they have workspace access enabled, the error will persist due to indirect dependency.
Please refer to the following documentation to learn more about how Simulink handles dictionary linking in libraries and best practices when designing such models:
I hope this helps.

More Answers (1)

Vidip
Vidip on 24 Jul 2025
You are seeing this error because Simulink does not allow libraries to link to data dictionaries with "Access to base workspace" enabled. This restriction ensures that libraries remain self-contained and reusable, without depending on external variables that may change between projects or users.
To resolve this, disable "Access to base workspace" in the data dictionary linked to your library. Also, check any referenced dictionaries and make sure none of them have workspace access enabled, as indirect dependencies will also trigger the error.
You can refer to the following documentation for more information:

Categories

Find more on Manage Design Data in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!