Main Content

coder.descriptor.DataInterface Class

Namespace: coder.descriptor

Return information about different types of data interfaces

Description

The coder.descriptor.DataInterface object describes various properties for a specified data interface in the generated code. The different types of data interfaces are:

  • Root-level inports and outports: An interface between the model and external models or systems, for exchanging data.

  • Parameters: Local and global parameters that describe the data for the block, lookup table, and the associated breakpoint set data.

  • Data Stores: A repository to store global and shared data that can be written and read.

  • Internal data: Internal data structures including DWork vectors, block I/O, and zero-crossings.

Creation

dataInterface = getDataInterfaces(codeDescObj, dataInterfaceName) creates a coder.descriptor.DataInterface object. The codeDescObj object is the coder.codedescriptor.CodeDescriptor object created for the model by using the getCodeDescriptor function.

Input Arguments

expand all

Name of the specified data interface.

Example: 'Inports'

Data Types: string

Properties

expand all

The data type associated with the data such as integer, double, matrix, and its properties.

Attributes:

GetAccess
public
SetAccess
public

The Simulink identifier (SID) is a unique number within the model that Simulink assigns to the block.

Attributes:

GetAccess
public
SetAccess
public

The name of the associated graphical entity.

Attributes:

GetAccess
public
SetAccess
public

The variant conditions in the model that interact with the data interface.

Attributes:

GetAccess
public
SetAccess
public

The description of how the data in the generated code is implemented. This property describes characteristics such as data type and size. In addition, it describes how the data is accessed or declared in the code. The property describes if the data is declared as a variable or structure member.

Attributes:

GetAccess
public
SetAccess
public

The rate at which data is accessed in a run-time environment.

Attributes:

GetAccess
public
SetAccess
public

Specified physical units as attributes on signals at the boundaries of model components.

Attributes:

GetAccess
public
SetAccess
public

The range of valid values for the block output signals.

Attributes:

GetAccess
public
SetAccess
public

Limitations

A bitfield data structure is generated if you select these configuration parameters:

  • Pack Boolean data into bitfields

  • Use bitset for storing state configuration

  • Use bitset for storing Boolean data

If the coder.descriptor.DataInterface represents a bitfield data structure, the Implementation property of the coder.descriptor.DataInterface object is empty.

Examples

collapse all

  1. Open the model.

    openExample(‘CustomCodeComments’)
  2. Build the model.

    slbuild('CustomCodeComments')
  3. Create a coder.codedescriptor.CodeDescriptor object for the required model.

    codeDescObj = coder.getCodeDescriptor('CustomCodeComments')
    
  4. Return a list of all data interface types in the generated code.

    dataInterfaceTypes = getDataInterfaceTypes(codeDescObj)
        {'Inports'         }
        {'Outports'        }
        {'Parameters'      }
        {'ExternalParameterObjects'}
        {'InternalData'    }
  5. Return properties of a specified data interface in the generated code.

    dataInterface = getDataInterfaces(codeDescObj, 'Inports')

    dataInterface is an array of coder.descriptor.DataInterface objects. Obtain the details of the first Inport block of the model by accessing the first location in the array.

    dataInterface(1)
    The first coder.descriptor.DataInterface object with properties is returned.
                  Type: [1×1 coder.descriptor.types.Double]
                   SID: 'CustomCodeComments:1'
         GraphicalName: 'In1'
           VariantInfo: [0×0 coder.descriptor.VariantInfo]
        Implementation: [1×1 coder.descriptor.StructExpression]
                Timing: [1×1 coder.descriptor.TimingInterface]

Version History

Introduced in R2018a