Issue with Changing Storage class 'slrealtim​e_PageSwit​ching'

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!

回答(1 个)

Aiswarya
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:
  1. Navigate to Apps tab and select the Embedded Coder app. This will open up a C Code tab.
  2. On the C Code tab, select Code Interface > Default Code Mappings. This will open the Code Mappings window.
  3. Under the Data Defaults section, you can change the storage class of External parameters to "ExportedGlobal" or "ImportedExtern".
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
  1 个评论
Dhivya
Dhivya 2024-3-14
Hi Aiswarya,
Thank you very much for the feedback.
In my project, the referenced model builds and generates hex/a2l files which is flashed in to the Controller to perform HIl test.
I currently have a simulink coder installed in the HIL PC. Here i would like to understand the specific difference of using embedded coder as im relatively new to the topic.
Could you please help me understand as to why im getting an error related to embedded coder.
Thank you again.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by