Main Content

Migration of Memory Section and Shared Utility Settings from Configuration Parameters to Code Mappings

For a model created in a release before R2018a, when you open the Embedded Coder app or use thecoder.mapping.createfunction, Simulink®将内存部分和共享实用程序设置从配置参数迁移到模型的代码映射。作为迁移的一部分,Simulink配置了模型使用的嵌金宝app入式编码器词典:

  • To refer to the package that defines the memory sections, as described inRefer to Code Generation Definitions in a Package

  • 要包含一个函数自定义模板,该模板指定命名规则,如果适用,则为共享实用程序指定的内存部分设置。

Effects of Migration

  • 迁移过程对模型文件进行更改,您必须保存。更改包括:

    • 将配置参数设置转换为代码映射。

    • 如果模型没有连接到一个数据字典,configuring the Embedded Coder Dictionary in the model file to refer to the memory section package and to contain a function customization template.

  • If the model is linked to a data dictionary, the migration process makes changes to the dictionary, which you must save. The changes include:

    • If the configuration parameters are stored in the model file (the model does not refer to aSimulink.ConfigSetobject), configuring the Embedded Coder Dictionary of the data dictionary to refer to the memory section package and to contain a function customization template.

      If the data dictionary references other dictionaries, the migration process configures the dictionary at the bottom of the reference hierarchy so other models and dictionaries in the hierarchy can use the memory section and function template definitions.

    • 如果模型是指Simulink.ConfigSet对象,配置存储对象的数据字典的嵌入式编码器词典。

Considerations Before Migrating

  • When you open the Embedded Coder app, Simulink executes the migration process. Do not open the Embedded Coder app unless you are ready to migrate memory section and shared utility naming settings.

    如果模型具有多个配置集(一个活动集(一个活动和一个或多个无活动)或指Simulink.ConfigSet对象,嵌入式编码器应用显示一条信息消息,指示来自引用配置集中的信息已导入到嵌入式编码器词典和代码映射中。

  • 如果您使用simuli金宝appnk数据词典,请在您或其他用户打开模型的嵌入式编码器应用程序之前,请考虑首先创建和配置字典。

    在引用数据字典的层次结构中(例如,与模型层次结构相似的字典层次结构),只有一个词典可以包含一个嵌入式编码器字典。在迁移相关模型之前设置数据词典使您可以控制嵌入式编码器词典位于字典层次结构中的位置。在层次结构的底部创建或标识数据字典,以便层次结构中的模型可以访问内存部分和功能模板定义。然后,当您通过为模型打开嵌入式编码器应用程序启动迁移时,Simulink会配置该数据字典。金宝app

    有关使用引用词典在模型之间共享嵌入式编码器词典的信息,请参见Share Embedded Coder Dictionary Definition Between Models

  • The migration process makes changes based on the active configuration set of the model (seeManage Configuration Sets for a Model) when you open the model in the Embedded Coder app. Before you open the model in the Embedded Coder app, activate the configuration set whose settings you want the migration process to use.

    The process ignores settings in inactive configuration sets. If different configuration sets of the model specify different settings, you must choose one set to migrate.

Considerations After Migrating

  • In a branching hierarchy of referenced models and referenced data dictionaries, after you or other users migrate referenced models in different branches, opening the Embedded Coder app in a parent model can generate an error due to the presence of multiple Embedded Coder Dictionaries in the data dictionary hierarchy. To resolve these errors, useCoder.dictionary.moveandcoder.dictionary.removeto transfer and delete Embedded Coder Dictionaries until only one dictionary remains. Place the remaining Embedded Coder Dictionary in a data dictionary at the bottom of the hierarchy so that the models in the hierarchy can access the memory section and function template definitions.

    有关使用引用词典在模型之间共享嵌入式编码器词典的信息,请参见Share Embedded Coder Dictionary Definition Between Models

  • 迁移模型后,内存部分和共享实用程序模型配置参数将无法访问。如果您使用set_paramorget_param为了以编程方式访问这些配置参数设置,函数会生成错误。要更改这些设置,请使用代码映射编辑器或编程接口如图所述C Data and Function Configuration

    如果模型包含具有非默认内存部分设置的原子子系统,则可以从加载到嵌入式编码器词典中的内置软件包中选择内存部分。看Override Default Memory Placement for Individual Data Elementsand覆盖子系统功能和数据的默认内存放置

  • 如果模型是指Simulink.ConfigSet对象,迁移后,模型不使用对象中的“内存”部分和共享实用程序设置。如果使用对象设置多个模型的配置参数:

    • Changing memory section and shared utility settings in the object affects only models that you have not migrated.

    • 迁移的模型不会从单个位置获取内存部分和共享实用程序设置(Simulink.ConfigSet目的)。要更改这些模型的设置,请使用每个模型的代码映射编辑器。

也可以看看

|

Related Topics