メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

setModelVariantControl

Configure Simulink.VariantControl object for code generation

R2025a 以降

    説明

    setModelVariantControl(codeMappingObj,variantControl,Name=Value) configures the specified Simulink.VariantControl object variantControl in the code mappings codeMappingObj for code generation. Specifying code generation attributes for a Simulink.VariantControl object using code mappings is supported when the object is defined in the model workspace and its Value property is set to a Simulink.Parameter object. Use this function to map the specified variant control to the storage class and storage class property settings that the code generator uses to produce C code.

    すべて折りたたむ

    Get the code mappings for model slexVariantParameterCodeMappings.

    openExample("simulinkcoder/ConfigureCodeGenForVariantParametersInModelWorkspaceExample");
    cm = coder.mapping.api.get("slexVariantParameterCodeMappings");

    Set the storage class for the variant control named Wiper defined in the model workspace to ExportedGlobal.

    setModelVariantControl(cm,"Wiper",StorageClass="ExportedGlobal");

    入力引数

    すべて折りたたむ

    Code mapping object (model code mappings) returned by a call to function coder.mapping.api.get.

    Name of Simulink.VariantControl object, specified as a character vector or string scalar.

    例: "varCtrl"

    データ型: char | string

    名前と値の引数

    すべて折りたたむ

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    例: StorageClass="ExportedGlobal"

    Storage class to set for the specified variant control. StorageClass is the name of a predefined storage class or a storage class that is defined in the Embedded Coder Dictionary associated with the model. See C コード生成のパラメーターの構成.

    Name for the variable that represents the variant control in the generated code, specified as a character vector or string scalar.

    データ型: char | string

    Option to enable or disable generation of the model parameter to an A2L calibration file, specified as a numeric or logical 1 (true) or 0 (false).

    Mask value to extract single bits from the variant control during calibration, specified as integer in hexadecimal format. This property is applicable only for integers.

    データ型: hexadecimal

    Option to enable or disable calibration of the variant control, specified as one of these values:

    • "Calibration" — Enable calibration.

    • "NoCalibration" — Disable calibration.

    Name of the method for converting the ECU-internal value to a physical value for easy readability, specified as a character vector or string scalar.

    データ型: char | string

    Optional display name of the variant control for measurement purpose in the calibration tool, which is different than the variant control name in the Simulink model, specified as a character vector or string scalar.

    データ型: char | string

    Special display format to be specified for measurement in the calibration tool. This format specification overrules the display format specified in CompuMethod of the variant control.

    バージョン履歴

    R2025a で導入