Main Content


Class: coder.codedescriptor.CodeDescriptor
Package: coder.codedescriptor

Return information of the specified data interface


dataInterface = getDataInterfaces(codeDescObj, dataInterfaceName)


dataInterface = getDataInterfaces(codeDescObj, dataInterfaceName) returns the type of data, SID, graphical name, timing, implementation, and variant information on the data interface that dataInterfaceName specifies.

Input Arguments

expand all

coder.codedescriptor.CodeDescriptor object for which you want to retrieve the information about generated code.

dataInterfaceName specifies the name of a data interface. To get a list of all the data interfaces in the generated code, call getDataInterfaceTypes().

Data Types: string

Output Arguments

expand all

The coder.descriptor.DataInterface object describes information about the specified data interface such as type of data, SID, graphical name, timing, implementation, and variant information.


  1. Build the model.


  2. Create a coder.codedescriptor.CodeDescriptor object for the required model.

    codeDescObj = coder.getCodeDescriptor('rtwdemo_comments')

  3. Return a list of all data interface types in the generated code.

    dataInterfaceTypes = getDataInterfaceTypes(codeDescObj)
    dataInterfaceTypes has these values:
        {'Inports'         }
        {'Outports'        }
        {'Parameters'      }

  4. Return properties of Inport blocks 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.
    The first coder.descriptor.DataInterface object with properties is returned.
                  Type: [1×1 coder.descriptor.types.Double]
                   SID: 'rtwdemo_comments:1'
         GraphicalName: 'In1'
           VariantInfo: [0×0 coder.descriptor.VariantInfo]
        Implementation: [1×1 coder.descriptor.StructExpression]
                Timing: [1×1 coder.descriptor.TimingInterface]

Introduced in R2018a