Code generation - export signals as struct

I encapsulate my signals (and parameters) in structures. Currently I am able to do this defining my signals with a Storage Class "Struct(Custom)". This yelds the following code
in my_model.c file
my_signal_struct_type my_signals;
in my_model_types.h file:
/* Type definition for custom storage class: Struct */
typedef struct my_signal_struct_tag {
real_T u1;
real_T u2;
real_T u3;
} my_signal_struct_type;
Now I am in the need to export these definitions and declarations to files that can be shared. I see that it is possible to declare my signals of type mpt.Signal and use the Storage Class "ExportToFile(Custom)", like this my signals are defined in a separated C and H files.. and that is exactly what I need!!! Well, alsmost exactly, the problem is that every signal is declared as a stand alone variable. I need them to be part of a structure.
I believe that I need to create my own custom storage class and modify the MPTUnstructured.tlc file, but i don't know how to start.

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Simulink Coder 的更多信息

提问:

2012-1-18

Community Treasure Hunt

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

Start Hunting!

Translated by