Main Content

Analyze Generated Data Code Interface Report

When you generate a code generation report, you can include a code interface report, which documents the generated code interface, including model entry-point functions and interface data. The code interface information helps you to review the generated code and integrate it with other code. The information in the report depends on the type of code interface configuration that you use. For models that use a service interface code configuration, the code interface report also includes information about services, as described in Analyze Generated Service Code Interface Report (Embedded Coder).

For code configured with data interfaces, the code interface report includes the following subsections:

  • Introduction — A high-level description of the data code interface report

  • Function Interfaces — Interface information about each model entry-point function, including model_initialize, model_step, and (if applicable) model_reset and model_terminate

  • Data Interfaces — Interface information about data elements, such as inports and outports, that are associated with the model

To generate a code interface report, select the configuration parameters Create code generation report and Code Interface Report, as described in Generate Code Generation Report.

To open the example models used in this topic, use the openExample command:

openExample('ConfigurationInterface');

Navigate Code Interface Report Subsections

To help you navigate code interface descriptions, the code interface report provides collapse/expand tokens and hyperlinks. For the Introduction, Function Interfaces, and Data Interfaces sections, click Hide or Show to collapse or expand that section.

The code interface report provides several forms of hyperlink navigation. For example:

  • The Table of Contents located at the top of the code interface report provides links to each section and subsection of the report.

  • Click a function name to go to its definition in the generated code.

  • Click the header file name for a function to go to the header file source listing.

  • If you selected the configuration parameter Code-to-model, click links for these constructs to go to the corresponding location in the model display:

    • Function argument

    • Function return value

    • Variable representing an inport

    • Variable representing an outport

    • Interface parameter (if the parameter source is a block)

    • Variable representing a data store (if the data store source is a Data Store Memory block)

For backward and forward navigation within the HTML code generation report, use the Back and Forward buttons above the Content section in the upper-left corner of the report.

Interpret the Function Interfaces Section

The Function Interfaces section of the code interface report is further categorized into subsections: Initialize Functions, Terminate Functions, Periodic Functions, and Aperiodic Functions. The subsections provide the following interface information, including model_initialize, model_step, and (if applicable) model_reset and model_terminate.

  • The function name.

  • Description of the purpose of the function including:

    • Sample time interval for functions that the code calls periodically. If the code does not call the function periodically, the section does not show a sample time.

    • A link to the associated model element for exported functions.

  • Header file information.

  • Function prototype, including the function name, parameters, and return value.

Function interfaces section of the code interface report.

Interpret the Data Interfaces Section

The Data Interfaces section of the code interface report is categorized into Inports, Outports, Parameters, and Internal data. It provides information about data elements associated with the model, including:

  • The code identifier (for example, input1) associated with the data elements in the generated code

  • The Simulink block name associated with the data interface

  • Description of the purpose of the service, including a link to the model element if the service is associated with a block

  • Data type information

  • Fixed-point scaling information (You must have a Fixed-Point Designer™ license to see fixed-point scaling information in the report. For more information on how scaling is represented in the table, see Fixed-Point Data Type and Scaling Notation (Fixed-Point Designer).)

  • Dimensions of the data element

Code interface report for the Configuration Interface model showing the sections for data interfaces.

Related Topics