Hi David,
MATLAB does not provide a direct setting or option in the Simulink model configuration or Embedded Coder settings to customize the const-ness of the get method for instance-specific parameters generated by Embedded Coder. The const keyword in C++ indicates that the object returned by the get method cannot be modified, which is a common practice to ensure that the internal state of an object can only be modified through controlled interfaces, thereby preserving the encapsulation and integrity of the data.
Instead you can use the set method generated by the embedded coder to modify the instance parameters. Follow the below given steps to do the same:
- Create an object of "InstP_model_t" called "model_InstP_new".
- Copy the const object returned by the "get_InstP" method to the "model_InstP_new" object.
- Make the necessary changes to the "model_InstP_new" object, for example:
model_InstP_new.ParameterStruct.Parameter = 42
- Call the "set_InstP" method with the "model_InstP_new" object as argument.
In this way you can modify the instance-specific parameters by using the get and set methods generated by Embedded oder.
Hope this helps.