coder.Dictionary - Configure Embedded Coder Dictionary - MATLAB (original) (raw)

Main Content

Namespace: coder

Configure Embedded Coder Dictionary

Description

An object of the coder.Dictionary class represents an Embedded Coder Dictionary. Use the object to perform operations on the Embedded Coder Dictionary, such as load packages of definitions and gain access to sections of the dictionary.

A coder.Dictionary object contains coder.dictionary.Section objects, which represent the categories of an Embedded Coder Dictionary. A coder.dictionary.Section object contains coder.dictionary.Entry objects, which represent the definitions stored in that section of the Embedded Coder Dictionary. The name of the section identifies the type of code definitions that the section contains. To access the sections of an Embedded Coder Dictionary, use a coder.Dictionary object. To access the dictionary entries within the section, use a coder.dictionary.Section object.

Methods

expand all

getCodeInterfaceType Determine whether coder.Dictionary object represents a service interface configuration or data interface configuration
getSection Return coder.dictionary.Section object that represents Embedded Coder Dictionary section
getSections Return coder.dictionary.Section objects of an Embedded Coder Dictionary
getDictionaryDefault Return default service for service interface section or default property value for data interface category
setDictionaryDefault Set default service for service interface section or default property value for data interface category
loadPackage Load package of code definitions into Embedded Coder Dictionary
unloadPackage Unload package of code definitions from Embedded Coder Dictionary
getLoadedPackages Return code definition packages loaded into Embedded Coder Dictionary
refreshPackage Refresh package definitions in Embedded Coder Dictionary
resetToDefault Restore Embedded Coder Dictionary to default state
get Get property value of Embedded Coder Dictionary with service interface configuration
set Set property value for Embedded Coder Dictionary with service interface configuration
valid Determine whether coder.Dictionary object represents a valid Embedded Coder Dictionary
empty Determine whether Embedded Coder Dictionary is empty

Examples

collapse all

Create a data dictionary to contain an Embedded Coder Dictionary.

dataDictionary = Simulink.data.dictionary.create("DataDictionary.sldd");

Create an Embedded Coder Dictionary in the data dictionary and use acoder.Dictionary object to represent the Embedded Coder Dictionary.

coderDictionary = coder.dictionary.create(dataDictionary)

coderDictionary =

Dictionary with Sections:

                StorageClasses: [1×1 coder.dictionary.Section]
                MemorySections: [1×1 coder.dictionary.Section]
FunctionCustomizationTemplates: [1×1 coder.dictionary.Section]

The Embedded Coder Dictionary contains threecoder.dictionary.Section objects, each of which represents a section of the dictionary.

Create a data dictionary to contain the Embedded Coder Dictionary.

dataDictionary = Simulink.data.dictionary.create("DataDictionary.sldd");

Create an Embedded Coder Dictionary in the data dictionary and use acoder.Dictionary object to represent the Embedded Coder Dictionary. Specify that the interface configuration type is service interface.

coderDictionary = coder.dictionary.create(dataDictionary,"ServiceInterface")

coderDictionary =

Dictionary with properties and Sections:

                ServicesHeaderFileName: 'services.h'
                     InitTermFunctions: [1×1 coder.dictionary.Section]
            PeriodicAperiodicFunctions: [1×1 coder.dictionary.Section]
                DataReceiverInterfaces: [1×1 coder.dictionary.Section]
                  DataSenderInterfaces: [1×1 coder.dictionary.Section]
                DataTransferInterfaces: [1×1 coder.dictionary.Section]
                       TimerInterfaces: [1×1 coder.dictionary.Section]
             ParameterTuningInterfaces: [1×1 coder.dictionary.Section]
     ParameterArgumentTuningInterfaces: [1×1 coder.dictionary.Section]
                 MeasurementInterfaces: [1×1 coder.dictionary.Section]
         SubcomponentInitTermFunctions: [1×1 coder.dictionary.Section]
SubcomponentPeriodicAperiodicFunctions: [1×1 coder.dictionary.Section]
                SharedUtilityFunctions: [1×1 coder.dictionary.Section]
                          InternalData: [1×1 coder.dictionary.Section]
                             Constants: [1×1 coder.dictionary.Section]
                        StorageClasses: [1×1 coder.dictionary.Section]
                    DataMemorySections: [1×1 coder.dictionary.Section]
                FunctionMemorySections: [1×1 coder.dictionary.Section]

The Embedded Coder Dictionary contains coder.dictionary.Section objects, each of which represents a category of service interfaces, functions, or code definitions in the dictionary.

Version History

Introduced in R2019b

expand all

You can now specify "Not measured" as the default value of theMeasurementInterfaces section in the coder dictionary, and you can specify "Not tunable" as the default value of theParameterTuningInterfaces andParameterArgumentTuningInterfaces sections in the dictionary. The"Not measured" and "Not tunable" entries are included in the dictionary, and are preselected as default values in newly created dictionaries. You can select other entries as dictionary default for these sections, but you cannot delete these entries from the dictionary.

Access the coder.Dictionary objects for Embedded Coder Dictionaries that use the service interface configuration. Previously, you could only access thecoder.Dictionary object for an Embedded Coder Dictionary that used the data interface configuration. The coder.Dictionary class now supports dictionaries of both interface configuration types.