- 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'
29 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Aiswarya
2024-3-5
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!