There are two ways of customizing shared utility function names:
- Using Embedded Coder Dictionary & Code Mappings Editor (R2018b+)
- Using the “Shared utilities identifiers format” model parameter
OPTION 1: Embedded Coder Dictionary & Code Mappings Editor
For ERT-based targets (C only), in the Embedded Coder Dictionary, define a
function customization template that specifies a custom function naming rule. For example, in order to add a custom prefix "myPrefix_" to the file names, specify the Naming Rule "myPrefix_$N$C":
Then, in the Code Mappings editor or by using the code mappings programming interface, map the Shared utility function category to that template: OPTION 2: Using the “Shared utilities identifiers format” parameter
For C++ ERT-based targets, AUTOSAR (Classic/Adaptive AUTOSAR and C++/DDS), or any releases older than R2018b, you can use the “Shared utilities identifiers format” (CustomSymbolStrUtil) model parameter:
To add a custom prefix "myPrefix_" to the file names, you can make use of the “$U” token which inserts the custom text specified in the option “Custom token text" (CustomUserTokenString). The following configuration will apply the desired naming scheme for the file names:
- Shared utilities identifier format: $U_$N$C
- Custom token text: myPrefix
The same is illustrated in the image below: You can also modify the above parameters by using the following MATLAB commands:
>> set_param(bdroot, 'CustomSymbolStrUtil', '$U_$N$C')
>> set_param(bdroot, 'CustomUserTokenString', 'myPrefix')