Main Content

model_terminate

Generated C/C++ entry-point function that contains termination code for a金宝appmodel

Description

example

voidmodel_terminate(void)is a generated C or C++ entry-point function called one time to execute termination code for a Simulink®model.

The generated calling interface of the termination entry-point function for a model differs depending on theLanguageCode interface packagingparameters. For more information, seeCode interface packaging. With Embedded Coder®, you can choose whether to generate a termination function for a model by using theTerminate function requiredparameter. If your application runs indefinitely, clear this parameter. For more information, seeTerminate function required(Embedded Coder).

To preview and customize the name of a generated C terminate entry-point function an Embedded Coder license is required. To preview the terminate entry-point function, open the Code Mappings editor and click theFunctionstab. To customize the function name, in the功能名称column click and edit the spreadsheet directly. To customize the function using a template, in theFunction Customization Template列选择一个模板以应用于该功能。有关更多信息,请参阅Configure Names for Individual C Entry-Point Functions(Embedded Coder), andConfigure Default Code Generation for Functions(Embedded Coder).

要查看生成的终止入口点功能,请打开Codeview or Code Generation Report and examine the source code for your model. For more information see,Analyze the Generated Code Interface(Embedded Coder).

Examples

collapse all

This example shows the basic workflow for how to configure, customize, generate, and examine the terminate entry-point function. This specific example generates a nonreusable C terminate function for the modelrtwdemo_irt_base.

  1. Open a model. For this example, usertwdemo_irt_base.

  2. Select a coder. In the Apps gallery, clickSimulink Coder或者Embedded Coder.

  3. Configure the parameters. In the Configuration Parameters dialog box, selectTerminate function required和set theLanguageCode interface packagingparameters. In this example, the parameters are set for you.

  4. (Embedded Coder only) Customize the function. Using Embedded Coder, you can customize the name of the terminate entry-point function.

    • Open the Code Mappings editor.

    • Click theFunctionstab.

    • Edit the spreadsheet directly. In the功能名称column, enter a name for the function.

  5. Generate code.

  6. Examine the generated code. In theCodeview, verify that the generated terminate function appears with the expected name and parameters.

Input Arguments

collapse all

The terminate entry-point C or C++ function provides an interface to terminate application code. By default, the generated function provides a空隙interface that does not have arguments.

Example:void

Output Arguments

collapse all

The terminate entry-point C or C++ function provides an interface to terminate application code. By default, the generated function provides a空隙interface that does not have a return value.

Example:void

版本嗨story

Introduced before R2006a