Attach Data Dictionary to Subsystem Reference
You can attach a data dictionary to a subsystem reference to store variables, objects, and interfaces. The scope of data you define in an attached data dictionary is the subsystem reference boundary. Using a data dictionary allows you to define all types of data and interfaces and reuse them in child blocks and instances of your subsystem reference.
Attach Data Dictionary to a Subsystem File
Attaching a data dictionary to a subsystem reference provides you with multiple capabilities, such as data storage, data-model linkage, and version handling. For more information, see What Is a Data Dictionary?
Create a new data dictionary or open an existing data dictionary.
To create a new data dictionary, in the Model Explorer, select File > New > Data Dictionary.
Addto add objects from the drop down list to the data dictionary.
Save the data dictionary.
To attach the data dictionary:
Open your subsystem file. In the Simulink® Editor, on the Modeling tab, click Subsystem Properties.
In the Subsystem Properties dialog box, on the External Data tab, click Browse to locate and open your data dictionary.
Click OK to attach the data dictionary.
Alternatively, you can attach the data dictionary by using the
After you have attached the data dictionary and saved your subsystem file, the data dictionary and its contents appear in the Model Explorer as an external data source for the subsystem file.
You can use variables and data types defined in the data dictionary within the subsystem reference boundary.
For example, select data types defined in the attached data dictionary from the Data type list in the child blocks and instances of your Subsystem Reference block.
Symbol Resolution Process
To determine model behavior, Simulink tries to find the values of symbols used to define model entities. See Symbol Resolution for more information. To resolve a symbol, Simulink searches through the accessible workspaces in hierarchical order for a variable or object whose name is same as the symbol's name.
When you attach a data dictionary with your subsystem file, the symbol resolution for any child block of a subsystem reference is restricted within the subsystem reference boundary. The dialog box displays the behavior change in symbol resolution when you attach a data dictionary.
Symbol resolution for any child block of a subsystem reference is:
Mask workspaces of all blocks starting upward from the child block till the mask workspace of Subsystem Reference block (see Masking Fundamentals).
The data dictionary attached with the Subsystem Reference block.
MATLAB® base workspace, only if the attached data dictionary has access to the base workspace.
To allow access to the MATLAB base workspace, in the Model Explorer, select your data dictionary and select Enable dictionary access to base workspace.
Considerations and Limitations
There are some considerations when you attach a data dictionary with a subsystem reference.
As the hierarchical symbol resolution is restricted, the Permit Hierarchical Resolution option on the Subsystem Reference block parameter dialog box is disabled and set to
The enumerated data types defined in the data dictionary of a subsystem reference are available outside the subsystem reference boundary.