필터 지우기
필터 지우기

Data Store Storage Class and Storage Type 2018b vs 2021b

조회 수: 4 (최근 30일)
Csaba
Csaba 2022년 9월 26일
댓글: Csaba 2024년 2월 26일
Hi, I use Data Stores in my Simulink models to link to 3rd party c-code. I used Matlab 2018b until now, and I'm migrating to 2021b right now. First, I noticed that the "Code Generation" section is missing from the Data Store Memory's block parameters UI. In 2018b it looked like this:
Now it looks like this:
I've found out that I have to use the "Simulink Coder app / Code Mappings - C" editor, where I have found my Data Stores, and set their Storage Class to what they were (ExportedGlobal), because for some reason they have defaulted to "auto"
My first question is: Why did they got the "auto" value when opening the original model with 21b? Why don't they preserve the original ExportedGlobal setting?
My other question is: why do I get this error now, when generating code?
Could not generate code for the XXXX model: The model ' XXXX ' defines storage
class 'ExportedGlobal', which has the property 'Storage Type' set to 'Unstructured'. This storage class
is specified as the default storage class for parameters, and the block '...' with the parameter 'Value' is itself or within the reusable subsystem '...'.
Parameters accessed by, or from within a reusable subsystem cannot use a storage class that has the
property 'Storage Type' set to 'Unstructured'.
The mentioned subsystem does not have to do anything with the Data Stores (as far as I know). I have searhced for the "Storage Type" property, but I haven't found it. Where is it?
Actually my application is quite simple, I have one Data Store Memory and a Data Store Write that writes some simple uin32 data into an ExportedGlobal variable, that can be used in 3rd party c code. It worked fine in 2018b until now.
What am I missing now? How can I migrate this stuff to 2021b?
Thanks

채택된 답변

Alexander Dahlmann
Alexander Dahlmann 2024년 2월 22일
I might be a bit late to this, but for anyone who has also stumbled across this issue, I found a good solution here after I spent many hours trying to figure this out.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by