- Navigate to Apps tab and select the Embedded Coder app. This will open up a C Code tab.
- On the C Code tab, select Code Interface > Default Code Mappings. This will open the Code Mappings window.
- Under the Data Defaults section, you can change the storage class of External parameters to "ExportedGlobal" or "ImportedExtern".
Issue with Changing Storage class 'slrealtime_PageSwitching'
28 views (last 30 days)
Show older comments
Im currently preparing a PIL test for a model block.While executing the test with Test manage, I face the following error,
"In model defaults mapping, storage class 'slrealtime_PageSwitching' for model element category External parameters for model 'xxx' is not compatible with storage class 'Default' for model element category External parameters for referenced model 'yyy/xxx'. Select compatible storage classes for global parameters and global data stores in model reference hierarchy."
Could anyone support me on how to change the settings of storage class? I would also like to know the programmable command for this setting to control via script in future.
There was a solution in one of the questions as "PageSwitching(slrealtime) in Code mappings -> Data Defaults -> External Parameters to other available options such as ExportedGlobal or ImportedExtern. ". But im unable to find this settings in Matlab.
Thank you in advance!
0 Comments
Answers (1)
Aiswarya
on 5 Mar 2024
Hi Dhivya,
I understand that you are getting an error regarding storage class compatibility in Code mappings. This can occur if you are using different code mappings settings for parent model and referenced model. The expected behaviour for different storage classes for signals across Model Reference Boundary is mentioned in the following link : https://www.mathworks.com/help/rtw/ug/storage-classes-for-parameters-and-signals-used-in-model-blocks.html#f1129274.
In order to change the storage class you have to use the Code Mappings Editor. Please refer to the following steps:
You can view the setting in the image given below:
In order to change this setting programmatically, you may refer to the following code:
cm = coder.mapping.api.get('myModel'); % Use your model name instead of myModel
setDataDefault(cm,'ExternalParameterObjects ','StorageClass','ImportedExtern');
You may refer to the following link for more information on the Code Mappings Editor for C: https://www.mathworks.com/help/ecoder/ref/codemappingseditorc.html
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!