How to solve the problem?Thank you
7 ビュー (過去 30 日間)
古いコメントを表示
For model 'SWC_TrqDMDwithTable', code mapping of 'Storage Class' to Model parameter 'MeanOS2IS_Use_bl_Par' refers to a definition in model code dictionary that does not exist. In Code Mappings editor, select a valid 'Storage Class' for Model parameter 'MeanOS2IS_Use_bl_Par'.
2 件のコメント
Image Analyst
2023 年 4 月 20 日
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
回答 (2 件)
Walter Roberson
2023 年 4 月 21 日
You have a model named SWC_TrqDMDwithTable that you are trying to generate code for using Simulink coder.
When you want to generate code in Simulink Coder, each Simulink model parameter must be mapped to a C data type. For example, you must choose whether a particular parameter is to be an 8 bit unsigned integer or a 32 bit signed integer or a double precision number.
When you are interfacing with outside code, the outside code might already have a strong opinion about the data type that needs to be used for the parameter.
If not, then you have to use your knowledge of the range of possible values for the parameter. Using arrays of smaller datatypes can make it faster to copy arrays around -- but the hardware is not necessarily optimized to perform calculations on the smallest data type, and which operations are faster on which datatypes is something that is specific to the variety of hardware being targetted. So Simulink cannot just assume particular values should have particular data types.
For any particular model, there is a "model code dictionary" in which the person developing the software has set up correspondances between parameter names and the required data type to generate for that parameter.
The model code dictionaries are created and managed by the Code Mappings Editor https://www.mathworks.com/help/rtw/ref/codemappingseditorc.html .
The model code dictionary for model SWC_TrqDMDwithTable is missing. It either has not been created yet, or did not get copied when the code was moved from somewhere else, or else got accidentally deleted.
You need to use the Code Mappings Editor to indicate what datatype you want for the model parameter MeanOS2IS_Use_bl_Par . Or you need to locate the existing model code dictionary and copy it into place.
(There might possibly be other parameters you need to define.)
loyal
2023 年 4 月 21 日
1 件のコメント
Walter Roberson
2023 年 4 月 21 日
Change the data time for the time signal to be double
Code generation is going to expect the time to be in seconds and fractions of a second, I suspect.
参考
カテゴリ
Help Center および File Exchange で Get Started with Embedded Coder についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!