Main Content

getDataInterfaces

Class: coder.codedescriptor.CodeDescriptor
Namespace: coder.codedescriptor

Return information of the specified data interface

Syntax

dataInterface = getDataInterfaces(codeDescObj, dataInterfaceName)

Description

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.

Examples

  1. Open the CustomCodeComments 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)
    dataInterfaceTypes has these values:
        {'Inports'         }
        {'Outports'        }
        {'Parameters'      }
        {'ExternalParameterObjects'}
        {'InternalData'    }

  5. 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.
    dataInterface(1)
    The first coder.descriptor.DataInterface object with properties is returned.
                  Type: [1×1 coder.descriptor.types.Type]
                   SID: 'CustomCodeComments:99'
         GraphicalName: 'In1'
           VariantInfo: [1×0 coder.descriptor.VariantInfo]
        Implementation: [1×1 coder.descriptor.DataImplementation]
                Timing: [1×1 coder.descriptor.TimingInterface]
                  Unit: ''
                 Range: [1×0 coder.descriptor.Range]

Version History

Introduced in R2018a