coder.descriptor.DataInterface - Return information about different types of data interfaces - MATLAB (original) (raw)
Main Content
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](#mw%5F96221af3-cdc6-4677-86ba-aed9b163572e))
creates a coder.descriptor.DataInterface
object. ThecodeDescObj
object is thecoder.codedescriptor.CodeDescriptor
object created for the model by using the getCodeDescriptor function.
Input Arguments
Name of the specified data interface.
Example: 'Inports'
Data Types: string
Properties
The data type associated with the data such as integer
,double
, matrix
, and its properties.
The Simulink identifier (SID) is a unique number within the model that Simulink assigns to the block.
The name of the associated graphical entity.
The variant conditions in the model that interact with the data interface.
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.
The rate at which data is accessed in a run-time environment.
Specified physical units as attributes on signals at the boundaries of model components.
The range of valid values for the block output signals.
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 thecoder.descriptor.DataInterface
object is empty.
For data represented by macros, no coder.descriptor.DataInterface
object is returned. Examples include data assigned to the following storage classes:
Define
ImportedDefine
CompilerFlag
Examples
- Open the model.
openExample(‘CustomCodeComments’) - Build the model.
slbuild('CustomCodeComments') - Create a
coder.codedescriptor.CodeDescriptor
object for the required model.
codeDescObj = coder.getCodeDescriptor('CustomCodeComments') - Return a list of all data interface types in the generated code.
dataInterfaceTypes = getDataInterfaceTypes(codeDescObj)
{'Inports' }
{'Outports' }
{'Parameters' }
{'ExternalParameterObjects'}
{'InternalData' } - Return properties of a specified data interface in the generated code.
dataInterfaces = getDataInterfaces(codeDescObj,'Inports')dataInterfaces
is an array ofcoder.descriptor.DataInterface
objects. Obtain the details of the first Inport block of the model by accessing the first location in the array.
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