addValueType - Add value type to Architectural Data section of Simulink data dictionary - MATLAB (original) (raw)
Main Content
Add value type to Architectural Data section of Simulink data dictionary
Since R2023b
Syntax
Description
Examples
To add a Simulink.dictionary.archdata.ValueType
object with a specified name to the data dictionary, use theaddValueType
function. For an example that shows more of the workflow for related functions, see Store Data in Architectural Data Section Programmatically.
Create or open a data dictionary. This example adds a value type to the data dictionary MyInterfaces.sldd
.
dictName = "MyInterfaces.sldd"; archDataObj = Simulink.dictionary.archdata.open(dictName);
Add a Simulink.dictionary.archdata.ValueType
object to the Architectural Data section of a data dictionary. You can set the data type, dimensions, and define a description of the created value type.
myValueType1 = addValueType(archDataObj,"myValueType1"); myValueType1.DataType = 'int32'; myValueType1.Dimensions = '[2 3]'; myValueType1.Description = "I am a Simulink ValueType";
This example adds aSimulink.dictionary.archdata.ValueType
object that inherits signal properties from an existing Simulink.ValueType object to the Architectural Data section of a data dictionary, MyInterfaces.sldd
.
Create or open a data dictionary.
dictName = 'MyInterfaces.sldd'; archDataObj = Simulink.dictionary.archdata.open(dictName);
Create and define a Simulink.ValueType
object.
simValueType = Simulink.ValueType; simValueType.DataType = 'single'; simValueType.Min = 11; simValueType.Max = 17; simValueType.Dimensions = [2 4 3]; simValueType.Description = 'Simulink value type';
Using the addValueType
function you can add aSimulink.dictionary.archdata.ValueType
object to the Architectural Data section of the data dictionary that inherits signal properties from theSimulink.ValueType
object simValueType
.
myNewValueType1 = addValueType(archDataObj, 'MyNewValueType',... SimulinkValueType=simValueType)
myNewValueType1 =
ValueType with properties:
Name: 'MyNewValueType'
DataType: 'single'
Minimum: '11'
Maximum: '17'
Unit: ''
Complexity: 'real'
Dimensions: '[2 4 3]'
Description: 'Simulink value type'
Owner: [1×1 Simulink.dictionary.ArchitecturalData]
Input Arguments
DataType
definition name in DataTypes
property array of archDataObj, specified as a character vector or string scalar.
Example: "airSpeed"
Output Arguments
Version History
Introduced in R2023b