Main Content

Create Code Generation Report

Generate a Traceability Report

Generate a万博1manbetx®PLC Coder™code generation report by using the Configuration Parameters dialog box:

  1. Verify that the model is open.

  2. Open thePLC Coderapp. Click thePLC Codetab.

  3. ClickSettingsand navigate to thePLC Code Generationpane.

  4. To enable report generation, select theReport>Generate traceability reportcheck box.

  5. To open the code generation report upon completion of code generation, select theReport>Open report automaticallycheck box. ClickOK.

  6. ClickGenerate PLC Codeto initiate code and report generation. The coder generates HTML report files as part of the code generation process. THE HTML report opens.

  • TheTraceability Reportsection enables you to account forEliminated / Virtual Blocksthat are untraceable, versus the listedTraceable Simulink Blocks / Stateflow Objects / MATLAB Scripts, providing a complete mapping between model elements and code.

  • TheStatic Code Metrics Reportsection provides generated code statistics. Metrics are estimated from static analysis of the generated code.

In theGenerated Filessection, you can click the names of source code files generated from your model to view their contents in a MATLAB®web browser window. In the displayed source code:

  • Global variable instances are hyperlinked to their definitions.

  • You can use the hyperlinks within the displayed source code to view the blocks or subsystems from which the code was generated. Click the hyperlinks to view the relevant blocks or subsystems in a Simulink model window.

  • You can view the generated code for a block in the model. To highlight a block's generated code in the HTML report, click the block and in thePLC Coder应用程序,REVIEW RESULTSpane, clickNavigate to Code.

For more information, see:

Limitation

If you generate a code generation report for a model, and then change the model, the report becomes invalid. To keep your code generation report current, after modifying the source model, regenerate code and the report. If you close and then reopen a model, regenerate the report.