Main Content

coder.mapping.api.CoderDictionary

Query and set the code settings of dictionary defaults in an Embedded Coder dictionary within a Simulink data dictionary

Since R2021a

    Description

    A coder dictionary code mappings object and its related functions enable you to configure C code generation settings for dictionary defaults in an Embedded Coder® dictionary within a Simulink® data dictionary. For model data categories, code mappings associate data categories with configurations that consist of a storage class and storage class properties. Reduce the effort of preparing a model for code generation by specifying default configurations for categories of data elements across a model.

    Creation

    Description

    myCoderDictionaryObj = coder.mapping.api.get(dictionary) returns the active code mappings for the specified dictionary as object myCoderDictionaryObj. Code mappings associate data elements in the data dictionary with configurations for code generation.

    If code mappings do not exist, Simulink returns an error. You can create a code mappings object with a call to coder.mapping.utils.create.

    example

    myCoderDictionaryObj = coder.mapping.utils.create(dictionary) creates a code mappings environment for the specified data dictionary and returns the mappings as object myCoderDictionaryObj. Code mappings associate data elements and functions with configurations for C or C++ code generation. If code mappings exist for the specified data dictionary, the function returns those code mappings.

    Input Arguments

    expand all

    Data dictionary for which to return code mappings object, specified as a character vector or string scalar representing the dictionary name.

    Example: "exCodeDefs.sldd"

    Data Types: char | string

    Object Functions

    getDataDefaultGet default code settings for data category
    getFunctionDefaultGet default function customization template or memory section for model functions category

    Examples

    collapse all

    For the data dictionary exCodeDefs.sldd, create the environment for configuring the data and functions for code generation. After calling this function, use calls to other functions listed under Object Functions to configure aspects of code generation for the interface elements.

    coder.mapping.utils.create("exCodeDefs.sldd");
    

    Version History

    Introduced in R2021a