Main Content

set

Class: coder.Dictionary
Namespace: coder

Set property value for Embedded Coder Dictionary with service interface configuration

Since R2023b

Syntax

set(dictionary,property,value)

Description

set(dictionary,property,value) sets the property value for the specified Embedded Coder Dictionary. set supports only Embedded Coder Dictionaries that use the service interface configuration.

Input Arguments

expand all

Embedded Coder Dictionary, specified as a coder.Dictionary object.

Property of the coder.Dictionary object, specified as a character vector or string scalar.

Example: 'ServicesHeaderFileName'

Data Types: string

Value to set for the property of the coder.Dictionary object, specified as a character vector or string scalar.

Example: 'my_services.h'

Data Types: string

Examples

expand all

Create a Simulink data dictionary that contains an Embedded Coder Dictionary. Create the Embedded Coder Dictionary so that it represents a service interface configuration.

dictionaryFile = Simulink.data.dictionary.create('codeDefinitions.sldd');
codeDictionary = coder.dictionary.create('codeDefinitions.sldd','ServiceInterface');

Get the name of the header file that the service interfaces use.

headerFile = get(codeDictionary,'ServicesHeaderFileName')
headerFile =

    'services.h'

The Embedded Coder Dictionary uses the default header file services.h for the services.

Configure the dictionary to use the header file my_services.h instead.

set(codeDictionary,'ServicesHeaderFileName','my_services.h');

The Embedded Coder Dictionary now uses the header file my_services.h for the services.

Version History

Introduced in R2023b