Clear Filters
Clear Filters

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

23 views (last 30 days)
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!

Answers (1)

Aiswarya
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:
  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 Comment
Dhivya
Dhivya on 14 Mar 2024
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.

Sign in to comment.

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!