craq
unread,May 24, 2016, 9:39:14 AM5/24/16You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I am generating C++ code from a few simulink models using the Target Language Compiler (TLC) a.k.a. rtwbuild from the Real-time Workshop. Tunable parameters are being generated differently for some models than in others, and I am struggling to figure out the cause of this difference. My observations so far are as follows
For model_A.slx
1) in the configuration menu, under "Data Import/Export", the "input" option is deselected, and the text next to it says [t,u] and is grayed out.
2) in the configuration menu, under Optimization -> Signals and Parameters, the option "Inline parameters" is selected and the "configure" button next to it is clickable. When I click on it, I get a list of the variables from the workspace with type "Simulink.Parameter". These do not correspond to the tunable parameters for this model
3) in the generated code, the model_A_types.h file defines two structs, one (struct_5tQ7R3iuTqV70votfqV83G) which has the tunable parameters inside it, and
typedef struct Parameters_model_A_ Parameters_model_A;
model_A.h then defines
struct Parameters_model_A {
struct_5tQ7R3iuTqV70votfqV83G my_tunable_params;
}
// Block parameters (auto storage)
#ifdef __cplusplus
extern "C" {
#endif
extern Parameters_model_A model_A_P;
#ifdef __cplusplus
}
#endif
For model_B.slx
1) in the configuration menu, under "Data Import/Export", the "input" option is selected, and the text next to it calls some functions to load data into the workspace
2) in the configuration menu, under Optimization -> Signals and Parameters, the option "Inline parameters" is selected but the "configure" button next to it is NOT clickable.
3) in the generated code, the model_B_types.h file defines several structs, e.g. struct_dWWLqdINfH09c5EDOzoSpD
model_B.h then defines
// Model block global parameters (auto storage)
extern struct_dWWLqdINfH09c5EDOzoSpD rtP_my_params
I would like to make both models use the same naming convention for the parameters, since I want to create a generic wrapper function for both model_A and model_B. At the moment, the wrapper for model_A refers to model_A_P.my_param and the wrapper for model_B refers to rtP_my_params.my_param. I don't really care which convention is used. If anyone knows where the difference comes from, or can point me in the direction of where to look, that would be great.
Since I'm not sure where the difference arises, I am not sure how to create a simple example from these relatively complicated models, but that is what I will try next.