Main Content

getDataType

Get data type in Simulink interface dictionary

Since R2022b

In R2023b the Architectural Data section of data dictionaries was introduced. When managing interfaces, data types, constants, and software address methods consider using the Simulink.dictionary.ArchitecturalData programmatic interfaces instead. For more information, see Programmatically Manage AUTOSAR Architectural Data.

Description

dataTypeObj = getDataType(dictObj,dtName) returns the data type object that represents the data type specified by dtName.

example

Examples

collapse all

To get the data type object that represents the specified data type name, use the getDataType function. For an example that shows more of the workflow for related functions, see Create and Configure Interface Dictionary.

Get the EnumType object for myColor data type name in the dictAPI dictionary object.

myColorObj = getDataType(dictAPI,'myColor')
myColorObj = 

  EnumType with properties:

            Name: 'myColor'
     Description: 'I am a Simulink Enumeration'
    DefaultValue: 'BLUE'
     StorageType: 'int16'
       Enumerals: [1×3 Simulink.interface.dictionary.Enumeral]
           Owner: [1×1 Simulink.interface.Dictionary]

Get the AliasType object for myAliasType1 data type name in the dictAPI dictionary object.

myAliasType1Obj = getDataType(dictAPI,'myAliasType1')
myAliasType1Obj = 

  AliasType with properties:

           Name: 'myAliasType1'
       BaseType: 'fixdt(1,32,16)'
    Description: ''
          Owner: [1×1 Simulink.interface.Dictionary]

Input Arguments

collapse all

Interface dictionary, specified as a Simulink.interface.Dictionary object. Before you use this function, create or open dictObj by using Simulink.interface.dictionary.create or Simulink.interface.dictionary.open.

DataType definition name in DataTypes property array of dictObj, specified as a character vector or a string scalar.

Example: "airSpeed"

Output Arguments

collapse all

DataType object created from a DataType element in a dictObj dictionary object.

Version History

Introduced in R2022b

collapse all