How to solve the problem?Thank you

7 visualizaciones (últimos 30 días)
loyal
loyal el 20 de Abr. de 2023
Comentada: Walter Roberson el 21 de Abr. de 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 comentarios
Image Analyst
Image Analyst el 20 de Abr. de 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 el 21 de Abr. de 2023
Editada: Walter Roberson el 21 de Abr. de 2023
I do not understand?

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 21 de Abr. de 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 comentario
loyal
loyal el 21 de Abr. de 2023
Your answer is very good, I benefit a lot, thank you very much!

Iniciar sesión para comentar.


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

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Embedded Coder en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by