How to solve the problem?Thank you

7 visualizzazioni (ultimi 30 giorni)
loyal
loyal il 20 Apr 2023
Commentato: Walter Roberson il 21 Apr 2023
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 Commenti
Image Analyst
Image Analyst il 20 Apr 2023
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
loyal
loyal il 21 Apr 2023
Modificato: Walter Roberson il 21 Apr 2023
I do not understand?

Accedi per commentare.

Risposte (2)

Walter Roberson
Walter Roberson il 21 Apr 2023
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.)
  1 Commento
loyal
loyal il 21 Apr 2023
Your answer is very good, I benefit a lot, thank you very much!

Accedi per commentare.


loyal
loyal il 21 Apr 2023
Hello,What can I do if "Time should be specified as doubles" appears in Test Manager?
  1 Commento
Walter Roberson
Walter Roberson il 21 Apr 2023
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.

Accedi per commentare.

Categorie

Scopri di più su Get Started with Embedded Coder in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by